-
Notifications
You must be signed in to change notification settings - Fork 12
Special case for "fat" ledger. Use compaction + CompactionFilter #413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
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.
6 files reviewed, 3 comments
Edit PR Review Bot Settings | Greptile
pub fn set_oldest_slot(&self, slot: Slot) { | ||
self.oldest_slot.store(slot, Ordering::Relaxed); | ||
} |
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.
logic: using Ordering::Relaxed here could lead to inconsistencies in a multi-threaded environment. Consider using Ordering::SeqCst for slot threshold changes
@@ -20,6 +21,7 @@ use crate::{ | |||
pub const DEFAULT_TRUNCATION_TIME_INTERVAL: Duration = | |||
Duration::from_secs(2 * 60); | |||
const PERCENTAGE_TO_TRUNCATE: u8 = 10; | |||
const FILLED_PERCENTAGE_LIMIT: u8 = 100 - PERCENTAGE_TO_TRUNCATE; | |||
|
|||
struct LedgerTrunctationWorker<T> { |
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.
syntax: Typo in struct name: 'LedgerTrunctationWorker' should be 'LedgerTruncationWorker'
struct LedgerTrunctationWorker<T> { | |
struct LedgerTruncationWorker<T> { |
f1ba00e
to
ee5d428
Compare
37dc7a1
to
a5cda6f
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!
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.
looks legit overall
@@ -111,71 +111,74 @@ pub fn init_commit_accounts_ticker( | |||
}) | |||
} | |||
|
|||
#[allow(unused_variables)] |
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.
why not delete the method altogether?
Combining CompactionFilter + ManualCompaction.
Greptile Summary
Implements an optimized cleanup mechanism for large ('fat') ledgers by combining RocksDB's CompactionFilter with manual compaction processes for efficient data purging.
PurgedSlotFilterFactory
indatabase/cf_descriptors.rs
to automatically filter old slots during compactionoldest_slot
tracking indatabase/rocks_db.rs
to safely manage data retention thresholdsget_lowest_slot()
andset_lowest_cleanup_slot()
instore/api.rs
to coordinate manual deletion with automatic compactiontruncate_fat_ledger
method inledger_truncator.rs
with performance measurements for compaction operations