Skip to content

Conversation

@peterbroadhurst
Copy link
Contributor

Resolves #595

  • No longer set CRORequirePublicBlobRefs when assembling the messages prior to dispatching a batch (timing issue with this seen in Blob retrieval issue in test with message cache hit #595)
  • Move upload of blobs from API thread, to the batch dispatch thread
  • Set CRORequirePublicBlobRefs when aggregating pins for broadcast messages

@codecov-commenter
Copy link

codecov-commenter commented Mar 11, 2022

Codecov Report

Merging #596 (e22a27d) into main (b0bac23) will not change coverage.
The diff coverage is 100.00%.

❗ Current head e22a27d differs from pull request most recent head 57b3bde. Consider uploading reports for the commit 57b3bde to get more accurate results

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #596   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          306       306           
  Lines        18023     18017    -6     
=========================================
- Hits         18023     18017    -6     
Impacted Files Coverage Δ
internal/assets/manager.go 100.00% <100.00%> (ø)
internal/batch/batch_manager.go 100.00% <100.00%> (ø)
internal/batch/batch_processor.go 100.00% <100.00%> (ø)
internal/broadcast/definition.go 100.00% <100.00%> (ø)
internal/broadcast/manager.go 100.00% <100.00%> (ø)
internal/broadcast/message.go 100.00% <100.00%> (ø)
internal/broadcast/operations.go 100.00% <100.00%> (ø)
internal/config/config.go 100.00% <100.00%> (ø)
internal/contracts/manager.go 100.00% <100.00%> (ø)
internal/data/data_manager.go 100.00% <100.00%> (ø)
... and 25 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b0bac23...57b3bde. Read the comment docs.

defer reader.Close()

// ... to the shared storage
d.Blob.Public, err = bm.sharedstorage.PublishData(ctx, reader)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the part where I got stuck before. How does this public ref 1) get stored in the database, and 2) not cause the data hash to change? Hasn't the batch been sealed and stored before we reach here?

Copy link
Contributor

@awrichar awrichar Mar 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After refreshing myself on the other recent batching changes, it looks like the answer to (2) is that the hash calculation changed to not include the public ref as part of the hash. That's good.

Still can't figure out (1), ie where this data item is updated in the database with the public reference received here. It's definitely updated when it's received again in the event aggregator, but I'd expect it's updated prior to that as well... I'm likely just missing something.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great point. It's not currently at the point the batch is written to the comms layer. As you observe, it is when it comes back in the other end at the end of this PR - but I actually optimized that away in a later change.

I will add it back in, as it's only a performance hit for blobs. But if it's ok will do that as a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 17b9f90 in #599

Copy link
Contributor

@awrichar awrichar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, but I left one big question above for the sake of my own understanding.

Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
@peterbroadhurst peterbroadhurst merged commit fa21655 into hyperledger:main Mar 14, 2022
@peterbroadhurst peterbroadhurst deleted the fix-595 branch March 14, 2022 13:12
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.

Blob retrieval issue in test with message cache hit

3 participants