-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Group operations for maybe_get_required_blobs
#4938
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
Group operations for maybe_get_required_blobs
#4938
Conversation
afck
left a comment
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 good to me; although it does make the code more complicated and in practice probably only a small fraction of blocks have a significant number of blobs. Either way, would be good to add some more comments to the code to make it easier to read.
| *maybe_blob = Some(blob); | ||
| break; | ||
| } | ||
| for (_, pending_blobs) in self |
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.
You probably want to continue here if maybe_blob.is_some()?
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, you are very much correct.
I changed that part of the code significantly, though.
| for (index, blob_id) in missing_indices.into_iter().zip(missing_blob_ids) { | ||
| for (_, pending_blob) in &pending_blobs { | ||
| if let Some(blob) = pending_blob.get(&blob_id).await? { | ||
| maybe_blobs[index].1 = Some(blob); |
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.
And break;?
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. Sorry.
| break; | ||
| .await?; | ||
| for (index, blob_id) in missing_indices.into_iter().zip(missing_blob_ids) { | ||
| for (_, pending_blob) in &pending_blobs { |
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.
(Strictly speaking, it's not a single pending_blob. It's still a collection of pending blobs that belong to a single 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.
Ok. renamed "pending_blobs" as "all_entries_pending_blobs" and "pending_blob" as "pending_blobs".
Motivation
The
pending_proposed_blobsneeds to be simplified. But before that, we can restructure the access code.Proposal
Group the operations in the querying of the data in
maybe_get_required_blobs.Test Plan
The CI.
Release Plan
Links
None.