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

[formal snapshots] Support without DB Checkpoint upload #14645

Merged
merged 1 commit into from
Nov 10, 2023

Conversation

williampsmith
Copy link
Contributor

@williampsmith williampsmith commented Nov 3, 2023

Description

Today in order for formal snapshots to work, we also need to enable full db checkpoint config, including providing an object store and awaiting upload. Some node operators may want to only upload formal snapshots without incurring the cost of also uploading and maintaining a db checkpoint snapshot. Moreover, we will eventually move to only supporting formal snapshots. This PR introduces the capability to configure a node to generate and upload formal snapshots (state snapshots) without the need to also upload db checkpoints. We do this by generating a minimal db checkpoint config for use by DBCheckpointHandler and introducing a separate loop path in the handler, which simply marks new db checkpoints with UPLOAD_COMPLETED marker so that they can be used for formal snapshots and subsequently gc'ed.

Test Plan

Ran locally for 5 epochs with the following relevant config

state-snapshot-write-config:
  object-store-config:
    object-store: "File"
    directory: "/opt/sui/db/local_snapshots"
  concurrency: 5

and with no db checkpoint config.

Observed snapshots being geenerated:

williamsmith in /opt/sui/db/authorities_db/full_node_db/db_checkpoints λ ls
epoch_4
williamsmith in /opt/sui/db/authorities_db/full_node_db/db_checkpoints λ cd ../snapshot
williamsmith in /opt/sui/db/authorities_db/full_node_db/snapshot λ ls
epoch_0 epoch_1 epoch_2 epoch_3
williamsmith in /opt/sui/db/authorities_db/full_node_db/snapshot λ cd ../..
williamsmith in /opt/sui/db/authorities_db λ cd ../local_snapshots
williamsmith in /opt/sui/db/local_snapshots λ ls
epoch_0 epoch_1 epoch_2 epoch_3
williamsmith in /opt/sui/db/local_snapshots λ ls epoch_3
1_1.obj  1_1.ref  MANIFEST _SUCCESS

If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process.

Type of Change (Check all that apply)

  • protocol change
  • user-visible impact
  • breaking change for a client SDKs
  • breaking change for FNs (FN binary must upgrade)
  • breaking change for validators or node operators (must upgrade binaries)
  • breaking change for on-chain data layout
  • necessitate either a data wipe or data migration

Release notes

Copy link

vercel bot commented Nov 3, 2023

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

Name Status Preview Comments Updated (UTC)
mysten-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 10, 2023 1:19am
sui-core ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 10, 2023 1:19am
sui-typescript-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 10, 2023 1:19am
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
explorer ⬜️ Ignored (Inspect) Visit Preview Nov 10, 2023 1:19am
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Nov 10, 2023 1:19am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Nov 10, 2023 1:19am

@williampsmith williampsmith force-pushed the support-db-checkpoint-without-upload branch from c87accb to f8e0010 Compare November 3, 2023 22:58
@williampsmith williampsmith force-pushed the support-db-checkpoint-without-upload branch from f8e0010 to 346ba76 Compare November 3, 2023 23:23
@williampsmith williampsmith changed the title Support DB Checkpoint without upload [formal snapshots] Support without DB Checkpoint upload Nov 3, 2023
@williampsmith williampsmith force-pushed the support-db-checkpoint-without-upload branch from 346ba76 to 2fdb180 Compare November 7, 2023 01:03
@williampsmith williampsmith marked this pull request as ready for review November 7, 2023 01:12
crates/sui-core/src/db_checkpoint_handler.rs Outdated Show resolved Hide resolved
crates/sui-core/src/db_checkpoint_handler.rs Outdated Show resolved Hide resolved
crates/sui-core/src/db_checkpoint_handler.rs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants