Commit 577fe3d
committed
fix(drive-abci): rebuild a ranked envelope that loses its race with a commit
A ranked page is committed to by an envelope built from several
independent storage reads, and those are not isolated from a concurrent
block commit. A commit landing inside that window leaves the ancestor
chain unreconcilable, grovedb rejects it, and the request fails. Before
this surface read through the prover, only `prove = true` was exposed;
now the default read path is too.
`query::service` already re-runs a query whose committed height moved,
which absorbs almost all of it, but `finalize_block` makes a commit
visible before publishing that height, and a request finishing inside
that gap is not retried. Rebuild the envelope instead of returning: the
condition is transient and a fresh envelope over settled state resolves
it.
Deliberately narrow. Only the chain mismatch is retried, bounded at two
extra attempts (~400 us total), and genuine corruption produces the same
rejection every time and so still surfaces — one envelope later, with a
`warn` that says a burst under load is the race while a persistent or
unloaded occurrence is not.
Also covers three defensive paths that had no tests: the shared entry
decoder's axis-shape and `k` guards, unreachable through grovedb today
and therefore worth pinning precisely because nothing else can reach
them, and the chain-mismatch detector's narrowness.
Reviewed-by: CodeRabbit (retry suggestion adopted; its exact-match
suggestion for the empty-tree marker was rejected — grovedb wraps merk's
constant in its own prefix, so exact matching would stop the mapper from
ever firing)1 parent f432daa commit 577fe3d
3 files changed
Lines changed: 186 additions & 29 deletions
Lines changed: 74 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1317 | 1317 | | |
1318 | 1318 | | |
1319 | 1319 | | |
1320 | | - | |
1321 | | - | |
1322 | | - | |
1323 | | - | |
1324 | | - | |
1325 | | - | |
1326 | | - | |
1327 | | - | |
1328 | | - | |
1329 | | - | |
1330 | | - | |
1331 | | - | |
1332 | | - | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
1333 | 1353 | | |
1334 | | - | |
1335 | 1354 | | |
1336 | 1355 | | |
1337 | 1356 | | |
1338 | 1357 | | |
1339 | | - | |
| 1358 | + | |
1340 | 1359 | | |
1341 | 1360 | | |
1342 | 1361 | | |
| |||
1345 | 1364 | | |
1346 | 1365 | | |
1347 | 1366 | | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
1348 | 1371 | | |
1349 | 1372 | | |
1350 | 1373 | | |
1351 | 1374 | | |
1352 | | - | |
| 1375 | + | |
| 1376 | + | |
1353 | 1377 | | |
1354 | 1378 | | |
1355 | 1379 | | |
| |||
1471 | 1495 | | |
1472 | 1496 | | |
1473 | 1497 | | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
1474 | 1527 | | |
1475 | 1528 | | |
1476 | 1529 | | |
| |||
1493 | 1546 | | |
1494 | 1547 | | |
1495 | 1548 | | |
1496 | | - | |
1497 | | - | |
1498 | | - | |
1499 | | - | |
1500 | | - | |
1501 | | - | |
1502 | | - | |
| 1549 | + | |
1503 | 1550 | | |
1504 | 1551 | | |
1505 | 1552 | | |
1506 | | - | |
1507 | | - | |
1508 | | - | |
1509 | | - | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
1510 | 1557 | | |
1511 | 1558 | | |
1512 | 1559 | | |
| |||
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3089 | 3089 | | |
3090 | 3090 | | |
3091 | 3091 | | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
| 3098 | + | |
| 3099 | + | |
| 3100 | + | |
| 3101 | + | |
| 3102 | + | |
| 3103 | + | |
| 3104 | + | |
| 3105 | + | |
| 3106 | + | |
| 3107 | + | |
| 3108 | + | |
| 3109 | + | |
| 3110 | + | |
| 3111 | + | |
| 3112 | + | |
| 3113 | + | |
| 3114 | + | |
| 3115 | + | |
| 3116 | + | |
| 3117 | + | |
| 3118 | + | |
| 3119 | + | |
| 3120 | + | |
| 3121 | + | |
| 3122 | + | |
| 3123 | + | |
| 3124 | + | |
| 3125 | + | |
| 3126 | + | |
| 3127 | + | |
| 3128 | + | |
| 3129 | + | |
| 3130 | + | |
| 3131 | + | |
| 3132 | + | |
| 3133 | + | |
| 3134 | + | |
| 3135 | + | |
3092 | 3136 | | |
Lines changed: 68 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| 61 | + | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
| |||
1685 | 1687 | | |
1686 | 1688 | | |
1687 | 1689 | | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
1688 | 1696 | | |
1689 | 1697 | | |
1690 | | - | |
| 1698 | + | |
1691 | 1699 | | |
1692 | | - | |
| 1700 | + | |
1693 | 1701 | | |
1694 | 1702 | | |
1695 | 1703 | | |
| |||
1702 | 1710 | | |
1703 | 1711 | | |
1704 | 1712 | | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
1705 | 1771 | | |
1706 | 1772 | | |
1707 | 1773 | | |
| |||
0 commit comments