go-ethereum/triedb/pathdb
rjl493456442 ca6e2d141b
Some checks are pending
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
triedb/pathdb: sync ancient store before journal (#32557)
This pull request addresses the corrupted path database with log
indicating:
`history head truncation out of range, tail: 122557, head: 212208,
target: 212557`

This is a rare edge case where the in-memory layers, including the write
buffer
in the disk layer, are fully persisted (e.g., written to file), but the
state history
freezer is not properly closed (e.g., Geth is terminated after
journaling but
before freezer.Close). In this situation, the recent state history
writes will be
truncated on the next startup, while the in-memory layers resolve
correctly.
As a result, the state history falls behind the disk layer (including
the write buffer).

In this pull request, the state history freezer is always synced before
journal,
ensuring the state history writes are always persisted before the
others.

Edit: 
It's confirmed that devops team has 10s container termination setting.
It
explains why Geth didn't finish the entire termination without state
history
being closed.

https://github.com/ethpandaops/fusaka-devnets/pull/63/files
2025-09-09 14:39:54 +02:00
..
buffer.go triedb/pathdb, eth: use double-buffer mechanism in pathdb (#30464) 2025-06-22 20:40:54 +08:00
config.go cmd, core, eth, triedb/pathdb: track node origins in the path database (#32418) 2025-09-05 10:37:05 +08:00
context.go core, triedb/pathdb: final integration (snapshot integration pt 5) (#30661) 2025-05-16 18:29:38 +08:00
database.go core/state: state size tracking (#32362) 2025-09-08 14:00:23 +08:00
database_test.go triedb/pathdb: add recovery mechanism in state indexer (#32447) 2025-09-08 16:07:00 +08:00
difflayer.go cmd, core, eth, triedb/pathdb: track node origins in the path database (#32418) 2025-09-05 10:37:05 +08:00
difflayer_test.go cmd, core, eth, triedb/pathdb: track node origins in the path database (#32418) 2025-09-05 10:37:05 +08:00
disklayer.go cmd, core, eth, triedb/pathdb: track node origins in the path database (#32418) 2025-09-05 10:37:05 +08:00
errors.go core, triedb/pathdb: final integration (snapshot integration pt 5) (#30661) 2025-05-16 18:29:38 +08:00
execute.go cmd, core, eth, triedb/pathdb: track node origins in the path database (#32418) 2025-09-05 10:37:05 +08:00
fileutils_unix.go triedb/pathdb: introduce file-based state journal (#32060) 2025-07-15 11:45:20 +08:00
fileutils_windows.go triedb/pathdb: introduce file-based state journal (#32060) 2025-07-15 11:45:20 +08:00
flush.go core, triedb/pathdb: final integration (snapshot integration pt 5) (#30661) 2025-05-16 18:29:38 +08:00
generate.go triedb/pathdb, eth: use double-buffer mechanism in pathdb (#30464) 2025-06-22 20:40:54 +08:00
generate_test.go triedb/pathdb, eth: use double-buffer mechanism in pathdb (#30464) 2025-06-22 20:40:54 +08:00
history.go triedb/pathdb, core: keep root->id mappings after truncation (#32502) 2025-08-29 15:43:58 +08:00
history_index.go all: replace fmt.Errorf with errors.New (#32286) 2025-07-28 10:13:18 +02:00
history_index_block.go triedb/pathdb: use binary.append to eliminate the tmp scratch slice (#32250) 2025-07-22 20:03:22 +08:00
history_index_block_test.go triedb/pathdb: use binary.append to eliminate the tmp scratch slice (#32250) 2025-07-22 20:03:22 +08:00
history_index_test.go triedb/pathdb: rename history to state history (#32498) 2025-08-26 08:52:39 +02:00
history_indexer.go triedb/pathdb: add recovery mechanism in state indexer (#32447) 2025-09-08 16:07:00 +08:00
history_indexer_test.go triedb/pathdb: rename history to state history (#32498) 2025-08-26 08:52:39 +02:00
history_inspect.go triedb/pathdb: rename history to state history (#32498) 2025-08-26 08:52:39 +02:00
history_reader.go triedb/pathdb, core: keep root->id mappings after truncation (#32502) 2025-08-29 15:43:58 +08:00
history_reader_test.go triedb/pathdb: add recovery mechanism in state indexer (#32447) 2025-09-08 16:07:00 +08:00
history_state.go triedb/pathdb, core: keep root->id mappings after truncation (#32502) 2025-08-29 15:43:58 +08:00
history_state_test.go triedb/pathdb, core: keep root->id mappings after truncation (#32502) 2025-08-29 15:43:58 +08:00
holdable_iterator.go trie/pathdb: state iterator (snapshot integration pt 4) (#30654) 2024-12-16 21:10:08 +08:00
holdable_iterator_test.go trie/pathdb: state iterator (snapshot integration pt 4) (#30654) 2024-12-16 21:10:08 +08:00
iterator.go all: fix problematic function name in comment (#32513) 2025-08-29 08:54:23 +08:00
iterator_binary.go triedb/pathdb, eth: use double-buffer mechanism in pathdb (#30464) 2025-06-22 20:40:54 +08:00
iterator_fast.go triedb/pathdb, eth: use double-buffer mechanism in pathdb (#30464) 2025-06-22 20:40:54 +08:00
iterator_test.go triedb/pathdb: fix journal resolution in pathdb (#32097) 2025-06-26 17:19:02 +02:00
journal.go triedb/pathdb: sync ancient store before journal (#32557) 2025-09-09 14:39:54 +02:00
layertree.go cmd, core, eth, triedb/pathdb: track node origins in the path database (#32418) 2025-09-05 10:37:05 +08:00
layertree_test.go cmd, core, eth, triedb/pathdb: track node origins in the path database (#32418) 2025-09-05 10:37:05 +08:00
lookup.go triedb/pathdb: introduce lookup structure to optimize state access (#30971) 2025-05-28 13:31:42 +02:00
metrics.go core/rawdb, triedb/pathdb: implement history indexer (#31156) 2025-06-24 14:36:12 +02:00
nodes.go cmd, core, eth, triedb/pathdb: track node origins in the path database (#32418) 2025-09-05 10:37:05 +08:00
nodes_test.go cmd, core, eth, triedb/pathdb: track node origins in the path database (#32418) 2025-09-05 10:37:05 +08:00
reader.go triedb/pathdb, core: keep root->id mappings after truncation (#32502) 2025-08-29 15:43:58 +08:00
states.go all: fix problematic function name in comment (#32513) 2025-08-29 08:54:23 +08:00
states_test.go all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
verifier.go all: improve ETA calculation across all progress indicators (#32521) 2025-09-01 13:47:02 +08:00