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.
storage: don't mutate caller's transaction in executeWriteBatch
With proposer-evaluated Raft, doing so would mutate the caller's transaction proto, with unclear (but definitely bad) implications. Do not mutate ba.Requests in optimizePuts. This fixes a source of data races in the experimental proposer-evaluated KV PR cockroachdb#10327. Updated `TestOptimizePuts` so that prior to the fix, it failed with ``` --- FAIL: TestOptimizePuts (0.01s) replica_test.go:1522: 2: optimizePuts mutated the original request slice: [[0].Put.Blind: false != true [1].Put.Blind: false != true [2].Put.Blind: false != true [3].Put.Blind: false != true [4].Put.Blind: false != true [5].Put.Blind: false != true [6].Put.Blind: false != true [7].Put.Blind: false != true [8].Put.Blind: false != true [9].Put.Blind: false != true] ```
- Loading branch information
Showing
2 changed files
with
85 additions
and
14 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