Skip to content
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

Resumable uploads have confusing account for "last committed byte" #6880

Closed
coryan opened this issue Jun 26, 2021 · 2 comments · Fixed by #7868
Closed

Resumable uploads have confusing account for "last committed byte" #6880

coryan opened this issue Jun 26, 2021 · 2 comments · Fixed by #7868
Assignees
Labels
api: storage Issues related to the Cloud Storage API. type: cleanup An internal cleanup or hygiene concern.

Comments

@coryan
Copy link
Contributor

coryan commented Jun 26, 2021

In the REST-based resumable uploads we define the "last committed byte" as the value returned by the Range header of a successful chunk upload. This is the 1-based index of the highest-byte committed by the service. We use 0 to represent "nothing committed yet". And it is trivial to make a "off by one error" when converting to C++ style ranges and 0-based indexing.

In the GRPC-based resumable uploads the service returns the "committed_size", that is the number of bytes already written.

I think it would be cleaner to use this definition everywhere.

@coryan coryan added the type: cleanup An internal cleanup or hygiene concern. label Jun 26, 2021
@coryan coryan added this to the Complete GCS+gRPC plugin milestone Jun 26, 2021
@coryan
Copy link
Contributor Author

coryan commented Sep 24, 2021

This cannot be done until we cleanup the mocking using internals (see #7142), and it does not affect the performance or correctness of the code, just how hard it is to maintain it. Removing from the milestone.

@coryan coryan removed this from the GCS+gRPC: Public Preview milestone Sep 24, 2021
@coryan coryan added the api: storage Issues related to the Cloud Storage API. label Jan 9, 2022
@coryan coryan self-assigned this Jan 10, 2022
@coryan
Copy link
Contributor Author

coryan commented Jan 10, 2022

Well, to fix #7835 I need to break any existing mocks anyway. Fixing this problem at the same time (not necessarily in the same PR) seems more reasonable.

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 Cloud Storage API. type: cleanup An internal cleanup or hygiene concern.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant