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

framework to preserve optimistic_slot in blockstore #25362

Merged
merged 2 commits into from
May 20, 2022

Conversation

jbiseda
Copy link
Contributor

@jbiseda jbiseda commented May 19, 2022

Problem

Latest optimistic_slot value is needed when coordinating a restart. This value can be lost if logging is disabled or logs are deleted.

Summary of Changes

blockstore column family changes to support storing optimistic slot information.

See #25311 for follow-on changes.

For release notes:
This change introduces a new rocksdb column family: optimistic_slots. If the validator software is subsequently downgraded the validator will fail to start with the following error:
'Failed to open ledger database: RocksDb(Error { message: "Invalid argument: Column families not opened: optimistic_slots" })'

This can be remedied by dropping the optimistic_slots column family. Use the ldb tool provided with the rocksdb distribution.

Confirm that the database contains the optimistic_slots column family:
ldb --db=<full_path_to_db_directory> list_column_families

Drop the optimistic_slots column family:
ldb --db=<full_path_to_db_directory> drop_column_family optimistic_slots

Fixes #

@jbiseda jbiseda requested review from yhchiang-sol and steviez May 19, 2022 04:10
@codecov
Copy link

codecov bot commented May 19, 2022

Codecov Report

Merging #25362 (f2fe1dd) into master (be1d606) will decrease coverage by 0.0%.
The diff coverage is 35.0%.

❗ Current head f2fe1dd differs from pull request most recent head 6116e88. Consider uploading reports for the commit 6116e88 to get more accurate results

@@            Coverage Diff            @@
##           master   #25362     +/-   ##
=========================================
- Coverage    82.1%    82.1%   -0.1%     
=========================================
  Files         616      616             
  Lines      169469   169489     +20     
=========================================
+ Hits       139161   139164      +3     
- Misses      30308    30325     +17     

@steviez
Copy link
Contributor

steviez commented May 20, 2022

Thanks for breaking this out into its' own PR - should make backporting much easier!

One thing - I think we should include the blockstore_purge.rs changes in this PR; we have precedent of doing this in the past, such as in #18897. Other than this, I think we're good. I'll hold off on my ship it as a double check for pulling in purge update

@steviez
Copy link
Contributor

steviez commented May 20, 2022

Also - I assume this will be end up being backported to v1.10 in order to provide compatibility with v1.11 (assuming the overall change will make it into master in time for v1.11)?

@jbiseda
Copy link
Contributor Author

jbiseda commented May 20, 2022

One thing - I think we should include the blockstore_purge.rs changes in this PR
I've added the purge changes here.

Copy link
Contributor

@steviez steviez left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@yhchiang-sol yhchiang-sol left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for splitting the PRs to allow back-porting.

Left one comment that might be a potential follow-up in the next PR.

@jbiseda jbiseda removed the v1.10 label May 20, 2022
@jbiseda jbiseda merged commit 8caf0aa into solana-labs:master May 20, 2022
@jbiseda jbiseda deleted the blockstore-last-slot-part1 branch May 21, 2022 01:00
@jbiseda jbiseda added the v1.10 label Jun 22, 2022
mergify bot pushed a commit that referenced this pull request Jun 22, 2022
(cherry picked from commit 8caf0aa)

# Conflicts:
#	ledger/src/blockstore.rs
#	ledger/src/blockstore_db.rs
#	ledger/src/blockstore_metrics.rs
mergify bot added a commit that referenced this pull request Jun 22, 2022
…#26131)

* framework to preserve optimistic_slot in blockstore (#25362)

(cherry picked from commit 8caf0aa)

# Conflicts:
#	ledger/src/blockstore.rs
#	ledger/src/blockstore_db.rs
#	ledger/src/blockstore_metrics.rs

* merge

* merge

Co-authored-by: Jeff Biseda <[email protected]>
jeffwashington pushed a commit to jeffwashington/solana that referenced this pull request Jun 24, 2022
…labs#25362) (solana-labs#26131)

* framework to preserve optimistic_slot in blockstore (solana-labs#25362)

(cherry picked from commit 8caf0aa)

* merge

* merge

Co-authored-by: Jeff Biseda <[email protected]>
jeffwashington pushed a commit to jeffwashington/solana that referenced this pull request Jun 24, 2022
…labs#25362) (solana-labs#26131)

* framework to preserve optimistic_slot in blockstore (solana-labs#25362)

(cherry picked from commit 8caf0aa)

* merge

* merge

Co-authored-by: Jeff Biseda <[email protected]>
jeffwashington pushed a commit to jeffwashington/solana that referenced this pull request Jun 29, 2022
jeffwashington pushed a commit to jeffwashington/solana that referenced this pull request Jun 29, 2022
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