Commit e1f88a4
authored
Fix snapshot calculation in ludicrous mode (#5636)
In ludicrous mode snapshot calculation is not happening correctly. This is resulting in no
snapshot being taken ever and hence w directory size is increasing with time.
For snapshot creation we need last applied raft index(such that all raft index entries before this index are also applied) and max timestamp out of all committed transactions. Committed
transactions are sent by Zero to all alpha leaders via subscription. In ludicrous mode we don't
send transaction to Zero while committing. Hence Zero doesn't have anything to send as part of
Oracle updates. Because of this, possible snapshot timestamp(maxCommitTs) in
calculateSnapshot() is always 0. Hence no snapshot is ever taken.
This PR addresses two issues:
Correction while marking raft index done. Now any raft index will only be marked as done once
we have applied mutations for proposal(raft entry).
For ludicrous mode, use StartTs of any transaction for calculating maxCommitTs snapshot in
calculateSnapshot()1 parent f77aaaf commit e1f88a4
2 files changed
Lines changed: 18 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
| 218 | + | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
423 | | - | |
| 423 | + | |
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
| 492 | + | |
500 | 493 | | |
501 | 494 | | |
502 | 495 | | |
| |||
1430 | 1423 | | |
1431 | 1424 | | |
1432 | 1425 | | |
| 1426 | + | |
| 1427 | + | |
1433 | 1428 | | |
1434 | | - | |
| 1429 | + | |
1435 | 1430 | | |
1436 | 1431 | | |
1437 | 1432 | | |
1438 | 1433 | | |
1439 | | - | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
1440 | 1438 | | |
1441 | 1439 | | |
1442 | 1440 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | | - | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| |||
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
| 86 | + | |
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
| |||
111 | 115 | | |
112 | 116 | | |
113 | 117 | | |
114 | | - | |
| 118 | + | |
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
| |||
122 | 126 | | |
123 | 127 | | |
124 | 128 | | |
| 129 | + | |
125 | 130 | | |
126 | 131 | | |
127 | 132 | | |
| |||
138 | 143 | | |
139 | 144 | | |
140 | 145 | | |
| 146 | + | |
141 | 147 | | |
142 | 148 | | |
143 | 149 | | |
| |||
0 commit comments