-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Blockstore special columns: minimize deletes in PurgeType::Exact #33498
Blockstore special columns: minimize deletes in PurgeType::Exact #33498
Conversation
We might still want the special-column-empty check from #33370, however, once I muck this up by removing the primary indexes. |
Codecov Report
@@ Coverage Diff @@
## master #33498 +/- ##
=======================================
Coverage 81.7% 81.7%
=======================================
Files 802 802
Lines 217832 217870 +38
=======================================
+ Hits 178117 178153 +36
- Misses 39715 39717 +2 |
Will give proper review tomorrow, but 100% agreed that checking for empty columns is a worthwhile change. I can break that out from 33370 as well; it would be logic in the purge exact function + logic to remove the dummy entries at primary index 2 (those entries are completely unused nowadays so we can safely remove while being backwards compatible). |
1407813
to
26a1a56
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and 🚀 for adding the unit test coverage too!
One of the original motivations for #33370 was that I had observed committing the massive write batch took much longer in comparison to iterating the blocks and finding tx sigs / address pubkeys to delete. I had mentioned this in DM to Tyera too, but I hadn't posted actual numbers so here are some to provide a public paper trail. I hacked up validator to perform
Some thoughts / summary:
Lastly, the numbers being so large provide justification on why having a check for empty columns is of value; I still plan on pushing that separately |
26a1a56
to
317048c
Compare
Sorry @steviez , can a get a re-✅ ? |
…ana-labs#33498) * Adjust test_purge_transaction_status_exact to test slots that cross primary indexes * Minimize deletes by checking the primary-index range * Fix test_purge_special_columns_compaction_filter
Problem
Currently,
Blockstore::purge_columns_exact()
gets called on cluster restarts and takes quite a while to complete. However, we can halve the number of special-column deletes in the write batch in half for nodes running with--enable-rpc-transaction-history
(ie RPC nodes), and eliminate them altogether for nodes without this flag (the majority of staked validators).Summary of Changes
We already read both values from the
transaction_status_index_cf
, so use this data in memory to determine which (if any) primary_index contains the slot in question.This is a reworking of functionality that is in #33370, but done in a way that works better with #33419