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

[wip] Goodbye manual rocksdb compaction#27529

Closed
ryoqun wants to merge 5 commits intosolana-labs:masterfrom
ryoqun:goodbye-manual-rocksdb-compaction
Closed

[wip] Goodbye manual rocksdb compaction#27529
ryoqun wants to merge 5 commits intosolana-labs:masterfrom
ryoqun:goodbye-manual-rocksdb-compaction

Conversation

@ryoqun
Copy link
Copy Markdown
Contributor

@ryoqun ryoqun commented Sep 1, 2022

Problem

manual compaction code and its accompanying PrimaryIndex purge mechanism can be decommissioned, now that we've transitioned to the compaction filter, which is initially introduced at #16697 (1+ year ago)

also, these unused code is still maintained, indicating confusion for newer team members due to my laziness: ref #27201

Ideally, i'd like this to be merged before the shiny new fifo compaction come in across all the live clusters to avoid three separate impls.

Summary of Changes

Remove it

@ryoqun
Copy link
Copy Markdown
Contributor Author

ryoqun commented Sep 1, 2022

@yhchiang-sol hey, could you take over this pr as a new blockstore expert, if possible?

this pr is very draft. i just removed the relevant code and saw cargo clippy --bin solana-validator to pass.

remaning tasks:

  • carefully read surrounding code to ensure removing these shouldn't cause troubles like malfunctioning purging
  • adjust all the test code as well (make ci greeen again!)
  • run the validator.
  • review back me (@ryoqun)

cc: @CriesofCarrots (as original primary index implmenter), @carllin (as past reviewer of relevant merged pr: #16697), @steviez (recently, i sensed you're nicely tagged with @yhchiang-sol as blockstore reviewer )

Comment thread validator/src/main.rs
[default: all validators]")
)
.arg(
Arg::with_name("no_rocksdb_compaction")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i think it's time to remove these flags finally, even at the cost of some command line compatility churn.

so, we need to announce this and following some flags to be stripped from all scripts well in advance. After all, these flags is no-op as of now. (cc: @willhickey; this pr won't be merged soon. just very early headsup)

Comment thread validator/src/main.rs

let private_rpc = matches.is_present("private_rpc");
let do_port_check = !matches.is_present("no_port_check");
let no_rocksdb_compaction = true;
Copy link
Copy Markdown
Contributor Author

@ryoqun ryoqun Sep 1, 2022

Choose a reason for hiding this comment

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

@yhchiang-sol i think you can tell all the deleted code here is indded unused because of this hard-coded flag.. ;) this was changed at #16697

xref: https://github.com/solana-labs/solana/pull/27529/files#r960164605

Comment on lines -350 to -353
if self.no_compaction {
info!("compact_storage: compaction disabled");
return Ok(false);
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines -16 to -18
/// A faster approximation of `Exact` where the purge process only takes
/// care of the primary index and does not update the associated entries.
PrimaryIndex,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i think this is another good starting point to understand this pr.

@yhchiang-sol
Copy link
Copy Markdown
Contributor

@ryoqun: FYI, so I am also drafting #27567: it introduces a new ShredStorageType RocksSlotTtl that has similar/same performance as FIFO but also honors our slot concept and is compatible with the existing level compaction.

I am still baking the PR and will soon run some experiments. If the experimental sound, then it's probably better than both FIFO and the default Level.

@yhchiang-sol
Copy link
Copy Markdown
Contributor

I am still baking the PR and will soon run some experiments. If the experimental sound, then it's probably better than both FIFO and the default Level.

Aghh, that doesn't work because DeleteFilesInRange is currently not supported in L0. Such a pity :'(.

@github-actions github-actions Bot added the stale [bot only] Added to stale content; results in auto-close after a week. label Dec 29, 2022
@github-actions github-actions Bot closed this Jan 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

stale [bot only] Added to stale content; results in auto-close after a week.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants