Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Make Blockstore::purge_special_columns_exact() bail if columns empty #33534

Merged
merged 2 commits into from
Oct 5, 2023

Conversation

steviez
Copy link
Contributor

@steviez steviez commented Oct 5, 2023

Problem

The special columns, TransactionStatus and AddressSignatures, are only
populated if --enable-rpc-transaction-history is passed. Cleaning these
columns for a range of slots is very expensive, as the block for each
slot must be read, deserialized, and then parsed to extract all of the
transaction signatures and address pubkeys.

Summary of Changes

This change adds a simple check to see if there are any values at all in
the special columns. If there are not, then the whole process described
above can be skipped for nodes that are not storing the special columns.

Fixes #

Steven Czabaniuk added 2 commits October 3, 2023 22:17
The special columns, TransactionStatus and AddressSignatures, are only
populated if --enable-rpc-transaction-history is passed. Cleaning these
columns for a range of slots is very expensive, as the block for each
slot must be read, deserialized, and then parsed to extract all of the
transaction signatures and address pubkeys.

This change adds a simple check to see if there are any values at all in
the special columns. If there are not, then the whole process described
above can be skipped for nodes that are not storing the special columns.
@steviez steviez force-pushed the bstore_purge_exact_early_bail branch from 4431a7c to 2be4a28 Compare October 5, 2023 02:26
let num_entries = 1;
let max_slot = 9;
for slot in 0..=max_slot {
let entries = make_slot_entries_with_transactions(num_entries);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole block below of generating entries / shreds / inserting shreds / writing transaction status is duplicated across several functions in both blockstore_purge.rs and blockstore.rs.

However, adding it here in order to avoid any potential merge conflicts with #33419, we can deduplicate stuff later

@steviez steviez requested a review from CriesofCarrots October 5, 2023 05:52
@steviez steviez merged commit fac0c3c into solana-labs:master Oct 5, 2023
@steviez steviez deleted the bstore_purge_exact_early_bail branch October 5, 2023 18:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants