forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resuscitation of cockroachdb#2818. This change enables 1PC txns for transaction contained in a single batch and sent to a single Range. Contrary to the previous incarnation, now the chunk of batch containing EndTransaction is split and re-sent before any other redundant requests have been made. More improvement is possible: If the EndTransaction request were to end up in the last Batch sent over the course of the multi-range request anyway, it would not need to be split up into its own chunk. There's no way of knowing that until the last range descriptor has been looked up though, at which point in time we've already sent requests, complicating the code. Hence, this optimization (which amounts to @bdarnell's suggestion in cockroachdb#2818) has been omitted for now due to the amount of code changes required. Unfortunately, the improvements here don't directly reflect in SQL benchmarks because of the way the Txn is used there. We need to optimize the SQL server to batch up as many commands as it can (basically until it reads data) and commit in the same round-trip if possible. Currently the Txn object is used deep down in the individual operations (for example `(*planner).Insert()`) so this isn't trivial. I will file an issue.
- Loading branch information
Showing
7 changed files
with
243 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.