-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Storage] Reorganize calculation and commit tasks in save_transactions/save_transaction_block. #8664
Conversation
…s/save_transaction_block.
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.
Looks legit
.par_chunks(chunk_size) | ||
.enumerate() | ||
.try_for_each(|(chunk_index, txns_in_chunk)| -> Result<()> { | ||
let batch = SchemaBatch::new(); |
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.
Does it really matter to use multiple batches? (and why does it matter only for transactions?)
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's ~10% faster in my benchmark.. (I only did it for txn because it is relatively larger comparing to other data types)
btw, I don't like it.
.with_label_values(&["save_transactions__work"]) | ||
.start_timer(); | ||
// TODO(grao): Write progress for each of the following databases, and handle the | ||
// inconsistency at the startup time. |
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.
not related to this pr, but we can't recover if it crashes in the middle? or we just ignore anything that's not covered by ledger info?
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 have a TODO to truncate those versions that are larger than ledger info version. It's probably not that critical if we assume there is no fork.
(It seems there are some places that call get_latest_transaction_info_option to get the latest version, we probably want to get the ledger info version instead, I will work on it in a separate PR)
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.
truncate is not a high pri, but what happens if txn has a different version than event for example. I thought state sync is using the last transaction info to fetch instead of last ledger info?
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.
Yes, that's a problem I was saying in the "()" above. I need to get it done before 1.6 cut. (it's not in the 1.5)
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.
get the ledger info version instead
the overall progress, you mean
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.
yes ^
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
…s/save_transaction_block. (#8664)
…s/save_transaction_block. (#8664)
…s/save_transaction_block. (aptos-labs#8664)
…s/save_transaction_block. (aptos-labs#8664)
…s/save_transaction_block. (#8664)
|
||
let ledger_batch = SchemaBatch::new(); | ||
self.save_ledger_info(new_root_hash, ledger_info_with_sigs, &ledger_batch)?; |
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.
This is missing in the new state sync flow (until a ledger info is saved)?
.unwrap(); | ||
self.ledger_db | ||
.metadata_db() | ||
.write_schemas(ledger_schema_batches.ledger_metadata_batch) |
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.
hmm.. this already makes the LedgerCommitProgress
meaningless?
Description
To get a better performance, still have room to tune/improve.
Test Plan