mirror of
https://github.com/XRPLF/rippled.git
synced 2026-10-02 09:48:04 +00:00
fix: Check the transaction map in the parallel ledger walk
`Ledger::walkLedger` returned `walkMapParallel`'s result directly when asked for a parallel walk, which skipped the transaction map walk and the missing-node logging that follow. `Application::loadOldLedger` is the only parallel caller, so `--load`, `--ledger`, `--ledgerfile` and `--replay` never checked a ledger's transaction map. The parallel result is now held in a local and combined with both maps' missing-node lists at the end. The early return could not simply be deleted: `walkMapParallel` reports a worker that cannot read the node store through its return value alone, so dropping the boolean would lose that answer while `missingNodes1` stays empty. This is an operational change for anyone using `--load` as a recovery step. A ledger whose transaction map is missing a node is now refused at startup rather than accepted. Refusing is the intent: the walk exists to decide whether every node of both maps is available, and until now it answered for only one of them. Two gtests in `src/tests/libxrpl/ledger/WalkLedger.cpp` build a ledger whose state map is complete and whose transaction map holds only its root, then check that both the parallel and the serial walk report it incomplete. A second case checks that a ledger with two complete maps passes on both paths. The first fails against the early return.
This commit is contained in:
@@ -330,6 +330,18 @@ public:
|
||||
void
|
||||
updateSkipList();
|
||||
|
||||
/**
|
||||
* Check that every node of both of this ledger's maps is available.
|
||||
*
|
||||
* The function walks the state map and then the transaction map, and logs
|
||||
* what it could not read.
|
||||
*
|
||||
* @param j The journal to log missing nodes to.
|
||||
* @param parallel Walk the state map on several threads. The transaction
|
||||
* map is always walked on one thread.
|
||||
* @return True when both maps are complete. False when either map is
|
||||
* missing a node.
|
||||
*/
|
||||
bool
|
||||
walkLedger(beast::Journal j, bool parallel = false) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user