This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
Begin phasing out Blockstore primary indexes #33370
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The existing codebase still contains remnants from when ledger cleaning was done with multiple primary indexes. This PR starts the process of phasing out a variable primary index.
0
while continuing to support both0
and1
for reads; this allows a node to upgrade and still have access to pre-existing that it might have had under primary index1
1
as well. This will reduce IOPS for queries that aren't in the DB (no second read for primary index1
) as well as lowering overhead on a few other queries (iegetsSgnaturesForAddress
).Another minor win is in
Blockstore::purge_columns_exact()
; this function currently gets called on cluster restarts and takes quite a while to complete. Having a single primary index will cut the number of deletes in the write batch in half for nodes running with--enable-rpc-transaction-history
(ie RPC nodes), and allow an early bail out for nodes without this flag (which should be the majority of staked validators).Summary of Changes