这是indexloc提供的服务,不要输入任何密码
Skip to content

fix(storage): Update offset on resumable upload retry #12086

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

Merged
merged 4 commits into from
May 1, 2025

Conversation

cjc25
Copy link
Contributor

@cjc25 cjc25 commented Apr 30, 2025

When resumable uploads retry, they may observe a flush offset which is past the start of the current send (in fact the whole send might have already completed). In that case, we avoided re-sending unnecessary data, but we didn't update the offset to account for the data not sent.

When resumable uploads retry, they may observe a flush offset which is
past the start of the current send (in fact the whole send might have
already completed). In that case, we avoided re-sending unnecessary
data, but we didn't update the offset to account for the data not sent.
@cjc25 cjc25 requested review from a team as code owners April 30, 2025 15:19
@cjc25 cjc25 changed the title fix: Update offset on resumable upload retry fix(storage): Update offset on resumable upload retry Apr 30, 2025
Copy link
Contributor

@tritone tritone left a comment

Choose a reason for hiding this comment

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

Talked with @cjc25 ; test coverage for this will come via a fix in storage-testbench.

@tritone tritone added the automerge Merge the pull request once unit tests and other checks pass. label Apr 30, 2025
@cjc25
Copy link
Contributor Author

cjc25 commented Apr 30, 2025

The test failure here is only on "earliest version" (go 1.23.6) not "latest version" (go 1.24.0):

=== RUN   TestRetryTimeoutEmulated
=== RUN   TestRetryTimeoutEmulated/grpc
    client_test.go:2228: GetBucket: got unexpected error: rpc error: code = DeadlineExceeded desc = context deadline exceeded; want 503
    client_test.go:2233: GetBucket: got unexpected error rpc error: code = DeadlineExceeded desc = context deadline exceeded, want to match DeadlineExceeded.
=== RUN   TestRetryTimeoutEmulated/http
--- FAIL: TestRetryTimeoutEmulated (0.42s)
    --- FAIL: TestRetryTimeoutEmulated/grpc (0.21s)
    --- PASS: TestRetryTimeoutEmulated/http (0.21s)

Which is... surprising :). Maybe just flaky comparison, but I don't think related to this PR. I can look later.

@tritone tritone added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 30, 2025
@tritone
Copy link
Contributor

tritone commented Apr 30, 2025

The test failure here is only on "earliest version" (go 1.23.6) not "latest version" (go 1.24.0):

=== RUN   TestRetryTimeoutEmulated
=== RUN   TestRetryTimeoutEmulated/grpc
    client_test.go:2228: GetBucket: got unexpected error: rpc error: code = DeadlineExceeded desc = context deadline exceeded; want 503
    client_test.go:2233: GetBucket: got unexpected error rpc error: code = DeadlineExceeded desc = context deadline exceeded, want to match DeadlineExceeded.
=== RUN   TestRetryTimeoutEmulated/http
--- FAIL: TestRetryTimeoutEmulated (0.42s)
    --- FAIL: TestRetryTimeoutEmulated/grpc (0.21s)
    --- PASS: TestRetryTimeoutEmulated/http (0.21s)

Which is... surprising :). Maybe just flaky comparison, but I don't think related to this PR. I can look later.

This is somewhat surprising for the emulator but might just be a flake; I triggered a rerun.

@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 30, 2025
@gcf-merge-on-green gcf-merge-on-green bot merged commit 6ce8fe5 into googleapis:main May 1, 2025
8 checks passed
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label May 1, 2025
@cjc25
Copy link
Contributor Author

cjc25 commented May 1, 2025

The test failure here is only on "earliest version" (go 1.23.6) not "latest version" (go 1.24.0):

=== RUN   TestRetryTimeoutEmulated
=== RUN   TestRetryTimeoutEmulated/grpc
    client_test.go:2228: GetBucket: got unexpected error: rpc error: code = DeadlineExceeded desc = context deadline exceeded; want 503
    client_test.go:2233: GetBucket: got unexpected error rpc error: code = DeadlineExceeded desc = context deadline exceeded, want to match DeadlineExceeded.
=== RUN   TestRetryTimeoutEmulated/http
--- FAIL: TestRetryTimeoutEmulated (0.42s)
    --- FAIL: TestRetryTimeoutEmulated/grpc (0.21s)
    --- PASS: TestRetryTimeoutEmulated/http (0.21s)

Which is... surprising :). Maybe just flaky comparison, but I don't think related to this PR. I can look later.

This is somewhat surprising for the emulator but might just be a flake; I triggered a rerun.

The issue is that we check specifically that the error is context.DeadlineExceeded, but this is a gRPC-layer DeadlineExceeded. I don't think that can be reliable: the context deadline is propagated to the server, so now there are two clocks, and the server might return a DeadlineExceeded error before the local context is actually cancelled.

I'll send a PR to check for gRPC errors too.

@cjc25 cjc25 deleted the resumable-upload-grpc-fix branch May 1, 2025 02:22
@cjc25
Copy link
Contributor Author

cjc25 commented May 1, 2025

#12092 to fix the flake

2FaceS-bit pushed a commit to 2FaceS-bit/google-cloud-go that referenced this pull request May 12, 2025
When resumable uploads retry, they may observe a flush offset which is past the start of the current send (in fact the whole send might have already completed). In that case, we avoided re-sending unnecessary data, but we didn't update the offset to account for the data not sent.
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.

3 participants