Repository navigation
fix(storage): send destination on gRPC copy when target BlobInfo is provided - #14784
Merged
Dhriti07 merged 3 commits intoOct 27, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the copy method in GrpcStorageImpl.java to ensure that if the caller provides a BlobInfo target (overrideInfo), the destination is always sent to the server, preventing it from falling back to copying the source object's metadata. There are no review comments, and I have no additional feedback to provide.
ShreyasSinha
approved these changes
Oct 27, 2026
| // otherwise we will clobber default values populated in the gcs server side for the object | ||
| // metadata | ||
| if (!cleanedDst.equals(Object.getDefaultInstance())) { | ||
| // If the caller provided a BlobInfo target (overrideInfo), always send the destination so the |
Contributor
There was a problem hiding this comment.
does the fix work generically for proto2, proto3 etc
Contributor
Author
There was a problem hiding this comment.
Yes, it should work generically. The FIX always sends destination when a target BlobInfo is given, even if it's empty. Proto2 and proto3 both send an empty destination to the server and don't drop it
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.
When copying with
CopyRequest.Builder#setTarget(BlobInfo), the Javadoc says the target info is set exactly to the givenBlobInfoand nothing is inherited from the source. The HTTP transport honors this, but the gRPC transport skippedRewriteObjectRequest.destinationwhenever the targetBlobInfohad no fields besides bucket/name. The server then copied the source object's metadata, so callers couldn't clear custom metadata on copy over gRPC.This change always sends
destinationwhenoverrideInfo()is true, matching HTTP behavior.setTarget(BlobId)is unchanged and still inherits from the source.