Skip to content

Conversation

BenWhitehead
Copy link
Collaborator

  • Add incremental checksums to all messages
  • Add final object_checksums for all finalization
  • Remove tests that were testing the same thing -- especially when the setup was fairly involved
  • Remove some Integration tests that are now covered by unit tests of the bidi stream / bidi upload state (redirect limits, etc)
  • Refactor lots of common messages and test run flows to reduce duplication and make debugging easier
  • Ignore some tests that previously would partially split data rather than messages -- the current implementation only evicts when a whole message is consumed
  • In general, signal onComplete() after onNext in response to a finalize message
  • Update ITAppendableUploadTest to run for multiple permutations of BlobAppendableUploadConfigs

@BenWhitehead BenWhitehead requested a review from a team as a code owner August 5, 2025 19:32
@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. api: storage Issues related to the googleapis/java-storage API. labels Aug 5, 2025
@BenWhitehead BenWhitehead force-pushed the nonblocking-appendable/11remove-old-impl branch from 174cd8f to 71e4e98 Compare August 5, 2025 19:55
@BenWhitehead BenWhitehead requested a review from a team as a code owner August 5, 2025 19:55
@BenWhitehead BenWhitehead force-pushed the nonblocking-appendable/12/test-refactoring branch from a820295 to f0abe68 Compare August 5, 2025 19:55
@BenWhitehead BenWhitehead force-pushed the nonblocking-appendable/11remove-old-impl branch from 71e4e98 to 60a6b1f Compare August 5, 2025 20:45
@BenWhitehead BenWhitehead force-pushed the nonblocking-appendable/12/test-refactoring branch 2 times, most recently from c2ce92f to 32afcf4 Compare August 5, 2025 22:21
@BenWhitehead BenWhitehead force-pushed the nonblocking-appendable/11remove-old-impl branch from 60a6b1f to 1e3b2ad Compare August 8, 2025 20:55
@BenWhitehead BenWhitehead force-pushed the nonblocking-appendable/12/test-refactoring branch from 32afcf4 to 72f9901 Compare August 8, 2025 20:55
@BenWhitehead BenWhitehead force-pushed the nonblocking-appendable/11remove-old-impl branch from 1e3b2ad to acff0cd Compare August 11, 2025 19:39
…ementation

* Add incremental checksums to all messages
* Add final object_checksums for all finalization
* Remove tests that were testing the same thing -- especially when the setup was fairly involved
* Remove some Integration tests that are now covered by unit tests of the bidi stream / bidi upload state (redirect limits, etc)
* Refactor lots of common messages and test run flows to reduce duplication and make debugging easier
* Ignore some tests that previously would partially split data rather than messages -- the current implementation only evicts when a whole message is consumed
* In general, signal `onComplete()` after `onNext` in response to a finalize message
* Update ITAppendableUploadTest to run for multiple permutations of BlobAppendableUploadConfigs
@BenWhitehead BenWhitehead force-pushed the nonblocking-appendable/12/test-refactoring branch from 72f9901 to 9a21428 Compare August 11, 2025 19:41
BlobAppendableUploadConfig.of()
.withFlushPolicy(FlushPolicy.maxFlushSize(2000))
.withCloseAction(CloseAction.FINALIZE_WHEN_CLOSING);
assumeTrue(

Choose a reason for hiding this comment

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

Nit: This could be better as three assertTrue() statements

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is an assumeTrue not assertTrue, which will dynamically skip running this tests if the statement is not true.

I think most of these assumes can go away once we're able to run our CI in prod against a live rapid bucket rather than the partial implementation of testbench used currently.

BenWhitehead added a commit that referenced this pull request Aug 20, 2025
## Description
feat: *breaking behavior* rewrite Storage.blobAppendableUpload to be non-blocking and have improved throughput (#3231)

Rewrite internals of BlobAppendableUpload to provide non-blocking write calls, and it take advantage of grpc async message handling.

When `AppendableUploadWriteableByteChannel#write(ByteBuffer)` is called, an attempt will be made to enqueue the bytes in the outbound queue to GCS.
If there is only enough room to partially consume the bytes provided in the `ByteBuffer` the write call will return early specifying the number of bytes actually consumed.

As acknowledgements come in from gcs, enqueued messages will be evicted freeing space in the outbound queue. Thereby allowing more bytes to be consumed and enqueued.

Given appendable objects are still in private preview I can't quote any metrics here, however preliminary benchmarking of several million objects across a range of sizes show across the board throughput improvments.

Because the channel's write call is now non-blocking, if you want to block your application until the full buffer is consumed some new helper methods have been added in StorageChannelUtils to provide blocking behavior.

A new method `MinFlushSizeFlushPolicy#withMaxPendingBytes(long)` has been added to allow limiting the number of pending outbound bytes. The default values is 16MiB, but can be configured lower if necessary.

## Release Notes

BEGIN_COMMIT_OVERRIDE

BEGIN_NESTED_COMMIT
feat: *breaking behavior* rewrite Storage.blobAppendableUpload to be non-blocking and have improved throughput (#3231)
END_NESTED_COMMIT

BEGIN_NESTED_COMMIT
feat: add StorageChannelUtils to provide helper methods to perform blocking read/write to/from non-blocking channels (#3231)
END_NESTED_COMMIT

BEGIN_NESTED_COMMIT
feat: add MinFlushSizeFlushPolicy#withMaxPendingBytes(long) (#3231)
END_NESTED_COMMIT

BEGIN_NESTED_COMMIT
fix: update BlobAppendableUploadConfig and FlushPolicy.MinFlushSizeFlushPolicy to default to 4MiB minFlushSize and 16MiB maxPendingBytes (#3249)
END_NESTED_COMMIT

BEGIN_NESTED_COMMIT
fix: make FlushPolicy${Min,Max}FlushSizeFlushPolicy constructors private (#3217)
END_NESTED_COMMIT

END_COMMIMT_OVERRIDE

## Sub PRs
This PR is made of up the following PRs, in sequence
1. #3217
2. #3218 
3. #3219
4. #3220
5. #3221
6. #3222
7. #3223
8. #3224 
9. #3225 
10. #3226 
11. #3227 
12. #3228 
13. #3229 
14. #3230 
15. #3235 
16. #3236 
17. #3241
18. #3242
19. #3246
20. #3248
21. #3249
22. #3252
@BenWhitehead
Copy link
Collaborator Author

Merged in #3231

@BenWhitehead BenWhitehead deleted the nonblocking-appendable/12/test-refactoring branch August 20, 2025 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/java-storage API. size: xl Pull request size is extra large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants