-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Make Blockstore::get_slots_since() filter out results for dead slots #28344
Conversation
This function is used by ReplayStage to find new slots to replay. If we know the slot is dead, then we can ignore the slot instead of creating the bank and later finding out that it is dead.
Think this one needs to go in v1.14 and v1.13/v1.10 |
.into_iter() | ||
.collect(); | ||
let dead_slots = dead_slots?; | ||
// If there is anything in the dead_slots cf for this slot, it is dead |
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.
cf = column family?
|
||
let slot_metas: Result<Vec<Option<SlotMeta>>> = self | ||
.meta_cf | ||
.multi_get(alive_slots.to_vec()) |
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.
alive_slots is already a vec. is this required to clone it?
@@ -5705,6 +5723,7 @@ pub mod tests { | |||
|
|||
#[test] | |||
fn test_get_slots_since() { | |||
solana_logger::setup(); |
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.
you can get rid of this
let slot_metas = slot_metas?; | ||
|
||
let result: HashMap<u64, Vec<u64>> = slots | ||
let result: HashMap<u64, Vec<u64>> = alive_slots |
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.
u64
could be Slot
for clarity and consistency.
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. @carllin should review the meaning/concept of get_slots_since
not returning dead slots for correctness.
Talking with Carl, this solution may not be the safest. I have another idea, but it is a little more involved. Will pursue that |
Circling back, this PR is NOT the correct approach to take as this comment calls out solana/core/src/replay_stage.rs Lines 1747 to 1749 in 6972afe
and which is later shown here solana/core/src/cluster_slot_state_verifier.rs Lines 499 to 515 in 6972afe
ReplayStage needs to know about these dead slots, so changing the function to not return them will definitely break things. Abandoning this PR in lieu of another apporach |
Problem
This function is used by ReplayStage to find new slots to replay. If we know the slot is dead, then we can ignore the slot instead of creating the bank and later finding out that it is dead.
Moreso, if the slot was processed in validator startup processing (
blockstore_processor::load_frozen_forks()
) and then also processed byReplayStage
, we will have created a bank for that slot twice, which causes a downchain failure.Summary of Changes
Filter out dead slots from
Blockstore::get_slots_since()
.Fixes #28343