Commit 8eb4a7c
authored
State Archival Consistency Invariant (#4968)
(Overview by @claude )
Introduce new invariant ArchivedStateConsistency that is invoked on
every commit.
### Eviction Checks (checkEvictionInvariants)
- Verifies that entries being archived don't already exist in the
archive
- Confirms that evicted entries actually exist in the current live state
- Validates that associated TTL (Time-To-Live) entries are properly
cleaned up when entries are archived
- Ensures archived entries contain the correct data from the live state
before eviction
### Restoration Checks (checkRestoreInvariants)
- Validates entries being restored from archive are correctly retrieved
- Ensures restored entries don't conflict with current live state
- Verifies TTL entries for restored persistent entries are handled
correctly
### Startup Validation
- On node startup, scans the complete hot archive and live bucket lists
- Ensures no entries exist in both live and archived state
simultaneously (critical consistency check)File tree
18 files changed
+1131
-34
lines changed- docs
- src
- bucket
- test
- invariant
- test
- ledger
- main
- test
- util
18 files changed
+1131
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
497 | 497 | | |
498 | 498 | | |
499 | 499 | | |
500 | | - | |
| 500 | + | |
501 | 501 | | |
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
505 | 511 | | |
506 | 512 | | |
507 | 513 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
1144 | 1146 | | |
1145 | 1147 | | |
1146 | 1148 | | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
1147 | 1152 | | |
1148 | 1153 | | |
1149 | 1154 | | |
| |||
1429 | 1434 | | |
1430 | 1435 | | |
1431 | 1436 | | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
1432 | 1482 | | |
1433 | | - | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
1434 | 1488 | | |
1435 | 1489 | | |
1436 | 1490 | | |
1437 | 1491 | | |
1438 | 1492 | | |
1439 | | - | |
| 1493 | + | |
1440 | 1494 | | |
1441 | | - | |
1442 | | - | |
| 1495 | + | |
1443 | 1496 | | |
1444 | 1497 | | |
1445 | 1498 | | |
| |||
1451 | 1504 | | |
1452 | 1505 | | |
1453 | 1506 | | |
1454 | | - | |
| 1507 | + | |
1455 | 1508 | | |
1456 | 1509 | | |
1457 | 1510 | | |
1458 | 1511 | | |
1459 | 1512 | | |
1460 | | - | |
| 1513 | + | |
| 1514 | + | |
1461 | 1515 | | |
1462 | 1516 | | |
1463 | 1517 | | |
1464 | 1518 | | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
1465 | 1537 | | |
1466 | 1538 | | |
1467 | 1539 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
171 | 173 | | |
172 | 174 | | |
173 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
174 | 183 | | |
175 | 184 | | |
176 | 185 | | |
| |||
378 | 387 | | |
379 | 388 | | |
380 | 389 | | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
381 | 393 | | |
382 | 394 | | |
383 | 395 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
| 191 | + | |
190 | 192 | | |
191 | 193 | | |
192 | 194 | | |
| |||
342 | 344 | | |
343 | 345 | | |
344 | 346 | | |
345 | | - | |
346 | | - | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
347 | 350 | | |
348 | 351 | | |
349 | 352 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| |||
0 commit comments