GCP: Route GCS batch deletes per credential prefix#16499
Open
wombatu-kun wants to merge 1 commit into
Open
Conversation
fec4f8b to
93daf9f
Compare
Contributor
Author
|
PR isn't the cause of Kafka Connect CI failure. I've fixed Kafka Connect integration test flakiness in separate PR #16438 |
Closes apache#16480 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
93daf9f to
99bf949
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #16480
GCSFileIO.internalDeleteFilespartitionedBlobIds into fixed-size batches and then selected the GCSStorageclient once per batch from only the first object's path. When a singleGCSFileIOis configured with multiple per-prefixStorageCredentials (vended-credentials flow), a batch that crossed prefix boundaries was issued in full through whichever client matched the first object — sending the rest of the batch through the wrong credentials. The fix groupsBlobIds by theirPrefixedStorageclient (via the existing longest-prefix-matchclientForStoragePathhelper) before partitioning into batches, and uses each client's owndeleteBatchSize. No public API or exception contract changes.This mirrors how
S3FileIO.deleteFilesalready groups by bucket before batching.Tests
Two new unit tests in
TestGCSFileIO:deleteFilesRoutesToCorrectClientPerPrefix— interleaves objects across two credential-prefixed buckets and asserts that each per-prefixStorageclient receives only its ownBlobIds.deleteFilesBatchesPerClient— sets a smallgcs.delete.batch-sizeand asserts that batches stay per-client and never mixBlobIds from two prefixes.Confirmed locally with
./gradlew :iceberg-gcp:test --tests "org.apache.iceberg.gcp.gcs.TestGCSFileIO"(26 tests, 0 failures). The new tests also fail when run against the previous code, confirming they catch the bug.