-
Notifications
You must be signed in to change notification settings - Fork 27
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
Storage/handle file overwrite #5108
Storage/handle file overwrite #5108
Conversation
b0e447f
to
7faf010
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #5108 +/- ##
======================================
Coverage 87.3% 87.4%
======================================
Files 1269 1269
Lines 52149 52174 +25
Branches 1129 1129
======================================
+ Hits 45572 45611 +39
+ Misses 6337 6323 -14
Partials 240 240
Flags with carried forward coverage won't be shown. Click here to find out more.
|
7faf010
to
ed21a43
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks for fixing this
6407991
to
84f028f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 amazing!
e2ead8f
to
81954d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
b12efec
to
2afba7a
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Code Climate has analyzed commit 2afba7a and detected 0 issues on this pull request. View more on Code Climate. |
What do these changes do?
This PR ensures that a file uploaded again first deletes the current file in the storage micro-service (both S3 and DB) before the links for uploading are returned.
The problem arose in #5102, where a file that was already uploaded before can be uploaded again only if no calls to
GET /locations/{{location_id}}/files/{{file_id}}/metadata
is done. If calls are done, there is a lazy mechanism in storage that fetches the file metadata from S3 to upgrade the database. As soon as this is called, then the upload information is wiped out of the database, which causes issues for multipart uploads (see remember how multipart upload works below)Update from last changes:
docker volume rm ops_minio_data
)remember how multipart upload works
In this case, since there was previously a file, S3 has information even though the brand new file is not uploaded yet.
Related issue/s
How to test
Dev Checklist
DevOps Checklist