Commit ce93650
committed
storage: add a generation counter to RangeDescriptors
Add a generation counter to RangeDescriptors which tracks the number of
splits and merges that range has seen. The counter is necessary to avoid
a rare edge case when a merge and replica addition occur concurrently.
See the comment on TestStoreRangeMergeAddReplicaRace for details.
The approach taken here to preserve encoding compatibility with existing
RangeDescriptors is to make RangeDescriptor a proto3 message. Adding a
new default zero integer field to a proto2 message is complicated
because proto2 makes a distinction between an integer that is zero and
integer that is unset.
Release note: None1 parent 28c7edc commit ce93650
9 files changed
Lines changed: 312 additions & 82 deletions
File tree
- c-deps/libroach/protos/roachpb
- pkg
- roachpb
- storage
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
142 | 159 | | |
143 | 160 | | |
144 | 161 | | |
| |||
182 | 199 | | |
183 | 200 | | |
184 | 201 | | |
185 | | - | |
| 202 | + | |
186 | 203 | | |
187 | 204 | | |
188 | 205 | | |
| |||
0 commit comments