Commit c3db5fe
committed
storage: improve safety of merge lock
Fix a known correctness bug in the merge locking scheme. See the comment
updates within for details.
As an added benefit, this fix frees store.RemoveReplica of conditionals
to deal with uninitialized replicas. Acquiring the merge lock now always
results in an initialized right-hand replica, so store.MergeRange is
always removing an initialized right-hand replica.
There are no tests for this because testing this particular edge case is
quite difficult and I'm primarily interested in avoiding the obviously
wrong call to batch.ClearRange(nil, nil) that occurs when calling
store.RemoveReplica on an unintialized replica. This nonsensical
ClearRange is, somehow, not currently an error, but it is preventing
landing.
Release note: None1 parent b5590dc commit c3db5fe
2 files changed
+39
-43
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5134 | 5134 | | |
5135 | 5135 | | |
5136 | 5136 | | |
5137 | | - | |
5138 | | - | |
5139 | | - | |
5140 | | - | |
5141 | | - | |
5142 | | - | |
5143 | | - | |
5144 | | - | |
5145 | | - | |
5146 | | - | |
5147 | | - | |
5148 | | - | |
5149 | | - | |
5150 | | - | |
5151 | | - | |
5152 | | - | |
5153 | | - | |
5154 | | - | |
5155 | | - | |
5156 | | - | |
5157 | | - | |
| 5137 | + | |
| 5138 | + | |
| 5139 | + | |
| 5140 | + | |
| 5141 | + | |
| 5142 | + | |
| 5143 | + | |
| 5144 | + | |
| 5145 | + | |
5158 | 5146 | | |
5159 | 5147 | | |
5160 | 5148 | | |
| 5149 | + | |
| 5150 | + | |
| 5151 | + | |
| 5152 | + | |
| 5153 | + | |
| 5154 | + | |
| 5155 | + | |
| 5156 | + | |
| 5157 | + | |
| 5158 | + | |
| 5159 | + | |
| 5160 | + | |
| 5161 | + | |
| 5162 | + | |
| 5163 | + | |
| 5164 | + | |
| 5165 | + | |
5161 | 5166 | | |
5162 | 5167 | | |
5163 | | - | |
| 5168 | + | |
5164 | 5169 | | |
5165 | 5170 | | |
5166 | 5171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2317 | 2317 | | |
2318 | 2318 | | |
2319 | 2319 | | |
2320 | | - | |
2321 | | - | |
| 2320 | + | |
2322 | 2321 | | |
2323 | 2322 | | |
2324 | 2323 | | |
| |||
2426 | 2425 | | |
2427 | 2426 | | |
2428 | 2427 | | |
2429 | | - | |
2430 | | - | |
| 2428 | + | |
2431 | 2429 | | |
2432 | 2430 | | |
2433 | 2431 | | |
| |||
2439 | 2437 | | |
2440 | 2438 | | |
2441 | 2439 | | |
2442 | | - | |
2443 | | - | |
2444 | | - | |
2445 | 2440 | | |
2446 | 2441 | | |
2447 | 2442 | | |
| |||
2498 | 2493 | | |
2499 | 2494 | | |
2500 | 2495 | | |
2501 | | - | |
2502 | | - | |
2503 | | - | |
2504 | | - | |
2505 | | - | |
2506 | | - | |
2507 | | - | |
2508 | | - | |
| 2496 | + | |
| 2497 | + | |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
2509 | 2502 | | |
2510 | 2503 | | |
2511 | 2504 | | |
| |||
2539 | 2532 | | |
2540 | 2533 | | |
2541 | 2534 | | |
2542 | | - | |
2543 | | - | |
2544 | | - | |
2545 | | - | |
2546 | | - | |
2547 | | - | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
2548 | 2539 | | |
2549 | 2540 | | |
2550 | 2541 | | |
| |||
0 commit comments