[CDAP-20954] Fix the precondition while uploading file to GCS incase of retries#15539
Merged
itsankit-google merged 1 commit intodevelopfrom Feb 8, 2024
Merged
[CDAP-20954] Fix the precondition while uploading file to GCS incase of retries#15539itsankit-google merged 1 commit intodevelopfrom
itsankit-google merged 1 commit intodevelopfrom
Conversation
dj-smart
approved these changes
Feb 7, 2024
masoud-io
reviewed
Feb 7, 2024
c3a55c2 to
4e7ae68
Compare
masoud-io
approved these changes
Feb 8, 2024
Contributor
masoud-io
left a comment
There was a problem hiding this comment.
One comment; otherwise LGTM.
Followup work: One main concern is that this code assumes that only one thread upload the file. This is a strong assumption and cannot be guaranteed 100% with system workers (e.g., a system worker stucks, appfabric timesout and send the request to another system worker. Now there are two system workers uploading the same artifacts). So it'd be great to think of a way to make sure the logic is correct even if multiple threads are uploading the same file.
4e7ae68 to
a412d98
Compare
This was referenced Feb 9, 2024
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.
JIRA: CDAP-20954
Fixes the issue:
context:
Above upload failed with
412which means object with specified name already exists, to override it, we fetch theblobInfofrom GCS and re-upload it usingGenerationNotMatchpre-condition which returns304which means generation number matched hence fixing the condition.GCS Docs reference: https://cloud.google.com/storage/docs/request-preconditions#precondition_criteria