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

Handle blockstore insert dup checks #16051

Merged
merged 4 commits into from
Mar 22, 2021
Merged

Conversation

carllin
Copy link
Contributor

@carllin carllin commented Mar 22, 2021

Problem

should_insert_data_shred() should check just_inserted_data_shreds() for certain shreds

Summary of Changes

Add get_data_shred_from_just_inserted_or_db() to fetch data shreds safely

Fixes #

@carllin carllin requested review from sakridge and jstarry March 22, 2021 08:19
@carllin carllin marked this pull request as draft March 22, 2021 08:20
ledger/src/blockstore.rs Outdated Show resolved Hide resolved
@carllin carllin changed the title Handle blockstore insert races with clear_unconfirmed_slot() Handle blockstore insert dup checks Mar 22, 2021
jstarry
jstarry previously approved these changes Mar 22, 2021
sakridge
sakridge previously approved these changes Mar 22, 2021
Copy link
Contributor

@sakridge sakridge left a comment

Choose a reason for hiding this comment

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

lgtm

@carllin carllin marked this pull request as ready for review March 22, 2021 19:29
@mergify mergify bot dismissed stale reviews from jstarry and sakridge March 22, 2021 19:32

Pull request has been modified.

@codecov
Copy link

codecov bot commented Mar 22, 2021

Codecov Report

Merging #16051 (2e4e9c7) into master (ff2242d) will increase coverage by 0.0%.
The diff coverage is 100.0%.

@@           Coverage Diff           @@
##           master   #16051   +/-   ##
=======================================
  Coverage    79.9%    79.9%           
=======================================
  Files         409      409           
  Lines      107723   107753   +30     
=======================================
+ Hits        86142    86171   +29     
- Misses      21581    21582    +1     

@carllin
Copy link
Contributor Author

carllin commented Mar 22, 2021

Ah dang, there's an annoying case here for the new model of handling duplicate blocks as well.

If somebody sends a batch with two shreds both last_index set to true, say for two shred indexes in the order 10, 9. Then the shred_index 9 won't be inserted because it fails the should_insert check. If shred 9 is part of the confirmed version of this slot, then this slot will never finish replay, and moreover, the slot is not marked dead and thus can't be dumped because it's never replayed (the entries are never successfully deserialized blockstore just sees a hole for shred 9 and is waiting for a consecutive set of shreds to deserialize)

@carllin carllin merged commit d76ad33 into solana-labs:master Mar 22, 2021
mergify bot pushed a commit that referenced this pull request Mar 22, 2021
mergify bot pushed a commit that referenced this pull request Mar 22, 2021
mergify bot added a commit that referenced this pull request Mar 23, 2021
(cherry picked from commit d76ad33)

Co-authored-by: carllin <carl@solana.com>
mergify bot added a commit that referenced this pull request Mar 23, 2021
(cherry picked from commit d76ad33)

Co-authored-by: carllin <carl@solana.com>
@brooksprumo brooksprumo mentioned this pull request Aug 23, 2021
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.

3 participants