Commit e14816e
committed
Journal reads must select segments before sstables to avoid compaction races
Also Fix Cassandra:
- In memory size calculation for CommandsForKey include Unmanaged
- Accord load out-of-band cleanup should use SafeRedundantBefore
ALso Improve Cassandra:
- Report replay information on begin replay
- Improve AccordService shutdown
- Log command store RedundantBefore on shutdown
- Segment compaction should wait for readOrder barrier to replace segments, for additional safety
- Journal segments should share readOrder with sstables
Also Improve Accord:
- Iterate LocalListeners in order, so can query more effectively on node
- Refine AbstractReplay.minReplay/shouldReplay
patch by Benedict; reviewed by Alex Petrov for CASSANDRA-218041 parent c295c33 commit e14816e
File tree
17 files changed
+193
-142
lines changed- modules
- src/java/org/apache/cassandra
- db/virtual
- journal
- service/accord
- test
- distributed/org/apache/cassandra/service/accord
- simulator/test/org/apache/cassandra/simulator/test
- unit/org/apache/cassandra/journal
17 files changed
+193
-142
lines changed- accord-core/src/main/java/accord/api/LocalListeners.java+2-2
- accord-core/src/main/java/accord/impl/AbstractReplayer.java+14-16
- accord-core/src/main/java/accord/impl/AbstractSafeCommandStore.java+2
- accord-core/src/main/java/accord/impl/DefaultLocalListeners.java+14-7
- accord-core/src/main/java/accord/impl/InMemoryCommandStore.java+2-1
- accord-core/src/main/java/accord/local/CommandStore.java+3-2
- accord-core/src/main/java/accord/local/CommandStores.java+1-2
- accord-core/src/main/java/accord/local/Commands.java+12-4
- accord-core/src/main/java/accord/utils/ReducingIntervalMap.java+11
- accord-core/src/main/java/accord/utils/ReducingRangeMap.java+10
Lines changed: 13 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
692 | 692 | | |
693 | 693 | | |
694 | 694 | | |
695 | | - | |
| 695 | + | |
696 | 696 | | |
697 | 697 | | |
698 | 698 | | |
| |||
726 | 726 | | |
727 | 727 | | |
728 | 728 | | |
729 | | - | |
| 729 | + | |
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
733 | 738 | | |
734 | 739 | | |
735 | 740 | | |
| |||
1796 | 1801 | | |
1797 | 1802 | | |
1798 | 1803 | | |
1799 | | - | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
1800 | 1808 | | |
1801 | 1809 | | |
1802 | 1810 | | |
| |||
1896 | 1904 | | |
1897 | 1905 | | |
1898 | 1906 | | |
1899 | | - | |
| 1907 | + | |
| 1908 | + | |
1900 | 1909 | | |
1901 | 1910 | | |
1902 | 1911 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
| 181 | + | |
181 | 182 | | |
182 | 183 | | |
183 | 184 | | |
184 | 185 | | |
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
| 189 | + | |
188 | 190 | | |
189 | 191 | | |
190 | 192 | | |
| |||
357 | 359 | | |
358 | 360 | | |
359 | 361 | | |
360 | | - | |
| 362 | + | |
361 | 363 | | |
362 | 364 | | |
363 | | - | |
| 365 | + | |
364 | 366 | | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
369 | 381 | | |
370 | 382 | | |
371 | 383 | | |
| |||
449 | 461 | | |
450 | 462 | | |
451 | 463 | | |
452 | | - | |
| 464 | + | |
453 | 465 | | |
454 | | - | |
| 466 | + | |
455 | 467 | | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
| 468 | + | |
| 469 | + | |
460 | 470 | | |
461 | | - | |
462 | | - | |
463 | | - | |
| 471 | + | |
| 472 | + | |
464 | 473 | | |
465 | 474 | | |
466 | 475 | | |
| |||
728 | 737 | | |
729 | 738 | | |
730 | 739 | | |
731 | | - | |
| 740 | + | |
732 | 741 | | |
733 | 742 | | |
734 | 743 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1321 | 1321 | | |
1322 | 1322 | | |
1323 | 1323 | | |
1324 | | - | |
| 1324 | + | |
1325 | 1325 | | |
1326 | 1326 | | |
1327 | 1327 | | |
| |||
Lines changed: 29 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
| 320 | + | |
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
423 | | - | |
| 423 | + | |
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
449 | | - | |
| 449 | + | |
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
454 | | - | |
| 454 | + | |
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
468 | 473 | | |
469 | 474 | | |
470 | 475 | | |
471 | 476 | | |
472 | 477 | | |
473 | 478 | | |
474 | 479 | | |
475 | | - | |
| 480 | + | |
476 | 481 | | |
477 | | - | |
478 | | - | |
| 482 | + | |
| 483 | + | |
479 | 484 | | |
480 | 485 | | |
481 | 486 | | |
| |||
540 | 545 | | |
541 | 546 | | |
542 | 547 | | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
543 | 555 | | |
544 | 556 | | |
545 | | - | |
| 557 | + | |
546 | 558 | | |
547 | 559 | | |
548 | | - | |
| 560 | + | |
549 | 561 | | |
550 | | - | |
551 | | - | |
| 562 | + | |
| 563 | + | |
552 | 564 | | |
553 | 565 | | |
554 | 566 | | |
| |||
558 | 570 | | |
559 | 571 | | |
560 | 572 | | |
561 | | - | |
| 573 | + | |
562 | 574 | | |
563 | 575 | | |
564 | 576 | | |
| |||
574 | 586 | | |
575 | 587 | | |
576 | 588 | | |
| 589 | + | |
577 | 590 | | |
578 | 591 | | |
579 | 592 | | |
580 | | - | |
581 | 593 | | |
582 | 594 | | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
583 | 599 | | |
584 | 600 | | |
585 | 601 | | |
| |||
Lines changed: 27 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| 48 | + | |
46 | 49 | | |
47 | | - | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| |||
206 | 209 | | |
207 | 210 | | |
208 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
209 | 218 | | |
210 | 219 | | |
211 | 220 | | |
212 | 221 | | |
213 | 222 | | |
214 | | - | |
215 | 223 | | |
216 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
217 | 237 | | |
218 | 238 | | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
227 | 242 | | |
228 | | - | |
| 243 | + | |
229 | 244 | | |
230 | 245 | | |
0 commit comments