Skip to content
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

fix(node): Merge from upstream - Delete consensus data from tables when it is no longer needed #5053

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

gokhan-simsek-iota
Copy link
Contributor

Description of change

Merging upstream changes: MystenLabs/sui@fedfb0d

From upstream:
This PR is in preparation for data quarantining. The DQ PR will move the tables affected by this PR entirely into memory, and crash recovery will be driven by re-processing consensus commits.

However, when we deploy DQ to a validator for the first time, we will restart in a state where uncertified consensus commits have already been marked as processed, so they will not be re-processed on startup.

This means that upon starting up for the first time, some data will be on disk instead of in memory. There are two possible solutions to this:

  • All reads fall back to the database. This is a lot of ugly code, and is slow.
  • All data in the database is read into memory at startup. This is fast and simple.

This PR bounds the amount of data we will have to read at startup in order to make the second option feasible.

Links to any relevant issues

Fixes: #4678

Type of change

Choose a type of change, and delete any options that are not relevant.

  • Bug fix (a non-breaking change which fixes an issue)

How the change has been tested

cargo run --release --bin iota start --force-regenesis --with-faucet

Change checklist

Tick the boxes that are relevant to your changes, and delete any items that are not.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that new and existing unit tests pass locally with my changes

@gokhan-simsek-iota gokhan-simsek-iota requested review from a team as code owners January 28, 2025 13:11
Copy link

vercel bot commented Jan 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
apps-backend ⬜️ Ignored (Inspect) Visit Preview Feb 4, 2025 9:20am
apps-ui-kit ⬜️ Ignored (Inspect) Visit Preview Feb 4, 2025 9:20am
rebased-explorer ⬜️ Ignored (Inspect) Visit Preview Feb 4, 2025 9:20am
wallet-dashboard ⬜️ Ignored (Inspect) Visit Preview Feb 4, 2025 9:20am

@iota-ci iota-ci added core-protocol node Issues related to the Core Node team labels Jan 28, 2025
@gokhan-simsek-iota gokhan-simsek-iota force-pushed the node/delete-redundant-consensus-data branch from 891630f to 9f2a099 Compare February 4, 2025 09:14
This PR is in preparation for data quarantining. The DQ PR will move the tables affected by this PR entirely into memory, and crash recovery will be driven by re-processing consensus commits.

However, when we deploy DQ to a validator for the first time, we will restart in a state where uncertified consensus commits have already been marked as processed, so they will not be re-processed on startup.

This means that upon starting up for the first time, some data will be on disk instead of in memory. There are two possible solutions to this:

- All reads fall back to the database. This is a lot of ugly code, and is slow.
- All data in the database is read into memory at startup. This is fast and simple.

This PR bounds the amount of data we will have to read at startup in order to make the second option feasible.
@gokhan-simsek-iota gokhan-simsek-iota force-pushed the node/delete-redundant-consensus-data branch from 9f2a099 to 7d26c6c Compare February 4, 2025 09:19
@gokhan-simsek-iota gokhan-simsek-iota merged commit 549795a into develop Feb 5, 2025
42 checks passed
@gokhan-simsek-iota gokhan-simsek-iota deleted the node/delete-redundant-consensus-data branch February 5, 2025 07:36
jkrvivian pushed a commit that referenced this pull request Feb 5, 2025
…ded (#5053)

This PR is in preparation for data quarantining. The DQ PR will move the tables affected by this PR entirely into memory, and crash recovery will be driven by re-processing consensus commits.

However, when we deploy DQ to a validator for the first time, we will restart in a state where uncertified consensus commits have already been marked as processed, so they will not be re-processed on startup.

This means that upon starting up for the first time, some data will be on disk instead of in memory. There are two possible solutions to this:

- All reads fall back to the database. This is a lot of ugly code, and is slow.
- All data in the database is read into memory at startup. This is fast and simple.

This PR bounds the amount of data we will have to read at startup in order to make the second option feasible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-protocol node Issues related to the Core Node team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delete consensus data from tables when it is no longer needed (#19697) · MystenLabs/sui@fedfb0d
4 participants