Commit 4e34e20
committed
hlc: switch timestamp flags to FromClock flag
The current approach to the synthetic flag on Timestamps had issues
which are avoided by the inversion of the flag's meaning as from_clock
(see later commit). Specifically, while inverting the flag optimizes the
encoded size of non-clock (currently synthetic) timestamps at the
expense of the encoded size of clock timestamps by 2 bytes, it comes
with major benefits that outweigh this cost. By making clock timestamps
opt-in instead of opt-out, we more closely match the capability model
we're trying to establish, where a clock timestamp can do everything a
normal timestamp can, but can also be used to update an HLC clock. The
opt-in nature mitigates the risk of bugs that forget to set this flag
correctly. Instead of risking a capability escalation where a non-clock
timestamp is incorrectly interpreted as a clock timestamp and used to
update an HLC clock, we risk a much less harmful capability
de-escalation where a clock timestamp loses its ability to update an HLC
clock. We can then much more carefully audit the cases where the flag
needs to be unset, such as in the Timestamp.Add and Timestamp.Forward
methods.1 parent b6c1215 commit 4e34e20
54 files changed
Lines changed: 487 additions & 567 deletions
File tree
- pkg
- ccl/changefeedccl
- kvfeed
- schemafeed
- cli
- kv
- kvclient/kvcoord
- kvnemesis
- kvserver
- batcheval
- closedts
- container
- minprop
- storage
- observedts
- protectedts
- ptcache
- ptstorage
- rangefeed
- rditer
- tscache
- roachpb
- sql/catalog/tabledesc
- storage
- enginepb
- metamorphic
- testdata/mvcc_histories
- util/hlc
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
215 | 214 | | |
216 | 215 | | |
217 | 216 | | |
| |||
267 | 266 | | |
268 | 267 | | |
269 | 268 | | |
270 | | - | |
271 | 269 | | |
272 | 270 | | |
273 | 271 | | |
| |||
286 | 284 | | |
287 | 285 | | |
288 | 286 | | |
289 | | - | |
290 | 287 | | |
291 | 288 | | |
292 | 289 | | |
| |||
303 | 300 | | |
304 | 301 | | |
305 | 302 | | |
306 | | - | |
307 | 303 | | |
308 | 304 | | |
309 | 305 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
822 | 822 | | |
823 | 823 | | |
824 | 824 | | |
825 | | - | |
| 825 | + | |
826 | 826 | | |
827 | 827 | | |
828 | 828 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
| 277 | + | |
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
471 | 471 | | |
472 | 472 | | |
473 | 473 | | |
474 | | - | |
| 474 | + | |
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
694 | 694 | | |
695 | 695 | | |
696 | 696 | | |
| 697 | + | |
697 | 698 | | |
698 | 699 | | |
699 | 700 | | |
| |||
2015 | 2016 | | |
2016 | 2017 | | |
2017 | 2018 | | |
2018 | | - | |
| 2019 | + | |
2019 | 2020 | | |
2020 | 2021 | | |
2021 | 2022 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
0 commit comments