Skip to content

Conversation

@rjl493456442
Copy link
Member

@rjl493456442 rjl493456442 commented Nov 27, 2025

This pull request optimizes history indexing by splitting a single large database
batch into multiple smaller chunks.

Originally, the indexer will resolve a batch of state histories and commit all
corresponding index entries atomically together with the indexing marker.

While indexing more state histories in a single batch improves efficiency, excessively
large batches can cause significant memory issues.

To mitigate this, the pull request splits the mega-batch into several smaller batches
and flushes them independently during indexing. However, this introduces a potential
inconsistency that some index entries may be flushed while the indexing marker is not,
and an unclean shutdown may leave the database in a partially updated state.
This can corrupt index data.

To address this, head truncation is introduced. After a restart, any excessive index
entries beyond the expected indexing marker are removed, ensuring the index remains
consistent after an unclean shutdown.

@rjl493456442 rjl493456442 force-pushed the improve-history-indexing branch from 5bef208 to 8d397b5 Compare December 4, 2025 03:55
@rjl493456442 rjl493456442 force-pushed the improve-history-indexing branch from 8d397b5 to 0035bcb Compare December 12, 2025 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant