-
Notifications
You must be signed in to change notification settings - Fork 11.5k
[archival] swtich state sync from archival store to checkpoints bucket #21955
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
Adding @aschran since he's more recently worked in this area than i have. I'm still planning on doing a review though :) |
if let Some(limit) = upper_limit { | ||
if checkpoint.checkpoint_summary.sequence_number > limit { | ||
if sequence_number > limit && self.pool_senders.len() == 1 { | ||
break; | ||
} | ||
} | ||
} | ||
Some(checkpoint) = checkpoint_recv.recv() => { |
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.
Is this a bug fix?
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.
depends — the semantics have changed. Previously, it was "don't process checkpoints with sequence number > upper_limit", and now it's "ensure that all checkpoints up to upper_limit are processed". Both work for state sync, but I think the latter is better. From what I can tell, the parameter isn’t currently used anywhere in the codebase
crates/sui-archival/src/lib.rs
Outdated
pub mod writer; | ||
|
||
#[cfg(test)] | ||
mod tests; |
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.
So the writer is being removed immediately? How does this impact the infra that we're running today for populating the archival? Or is this the archival that used to run inside the node and the one that runs as a part of ingestion framework still functions?
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.
yeah, that's the old writer. Data ingestion still works after the change
'inner: { | ||
let start = highest_synced | ||
.checked_add(1) | ||
.expect("Checkpoint seq num overflow"); | ||
let end = lowest_checkpoint_on_peers.unwrap(); | ||
|
||
let Some(ref archive_config) = archive_config else { | ||
warn!("Failed to find an archive reader to complete the state sync request"); | ||
break 'inner; | ||
}; | ||
let Some(ref ingestion_url) = archive_config.ingestion_url else { | ||
warn!("Archival ingestion url for state sync is not configured"); | ||
break 'inner; | ||
}; | ||
let reader_options = ReaderOptions { | ||
batch_size: archive_config.download_concurrency.into(), | ||
upper_limit: Some(end), | ||
..Default::default() | ||
}; | ||
let Ok((executor, _exit_sender)) = setup_single_workflow( | ||
StateSyncWorker(store.clone()), | ||
ingestion_url.clone(), | ||
start, | ||
1, | ||
Some(reader_options), | ||
) | ||
.await | ||
{ | ||
let txn_counter = Arc::new(AtomicU64::new(0)); | ||
let checkpoint_counter = Arc::new(AtomicU64::new(0)); | ||
if let Err(err) = archive_reader | ||
.read( | ||
store.clone(), | ||
checkpoint_range, | ||
txn_counter.clone(), | ||
checkpoint_counter.clone(), | ||
true, | ||
) | ||
.await | ||
{ | ||
warn!("State sync from archive failed with error: {:?}", err); | ||
} else { | ||
info!("State sync from archive is complete. Checkpoints downloaded = {:?}, Txns downloaded = {:?}", checkpoint_counter.load(Ordering::Relaxed), txn_counter.load(Ordering::Relaxed)); | ||
else { | ||
break 'inner; | ||
}; |
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.
I'm having a little bit of trouble understanding the break 'inner
control flow here. would this maybe be clearer if it was a separate function that could early return or something?
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.
it just skips to the last statement in the loop(i.e. sleep), but I don't mind
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.
Thanks!
Lets also make sure to add some information into the release notes about this change.
cc @abhinavg6
@bmwill - By release notes, do you mean those would be available here - https://github.com/MystenLabs/sui/releases? Also, considering this is part 1 of deprecation, is it worth documenting our overall intent now at https://docs.sui.io/guides/operator/archives and any other pertinent places? Or shall we wait until deprecation happens when we have the Bigtable interface for KV store? |
For release notes, checking a box and adding some info in the PR cover letter should suffice. As for documentation's our plans, yeah we should probably start doing that. |
I updated release note section. Feel free to edit it to better reflect the change.
The change is not related to the KV store. The previous archive solution will be replaced by the existing ingestion bucket of checkpoints |
MystenLabs#21955) ## Description Part 1 of deprecation of existing archival storage. Notes: * switches StateSync from archival store to checkpoint bucket * removes the notion of archival from pruning policies * removes write-archival config from Sui node config --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [x] Nodes (Validators and Full nodes): Switches Sui archive mechanism for state sync from the existing format to checkpoint data ingestion bucket. The `state-archive-read-config` section of the full node config needs to be updated to include the `ingestion-url` field. For possible bucket options, see: https://docs.sui.io/guides/developer/advanced/custom-indexer#remote-reader. - [ ] gRPC: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
Description
Part 1 of deprecation of existing archival storage.
Notes:
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.
state-archive-read-config
section of the full node config needs to be updated to include theingestion-url
field. For possible bucket options, see: https://docs.sui.io/guides/developer/advanced/custom-indexer#remote-reader.