mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-24 21:06:02 +03:00
[PR #2348] [MERGED] Fixed a bug in the re-upload part of Streamupload #2493
Labels
No labels
bug
bug
dataloss
duplicate
enhancement
feature request
help wanted
invalid
need info
performance
pull-request
question
question
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/s3fs-fuse#2493
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/2348
Author: @ggtakec
Created: 10/15/2023
Status: ✅ Merged
Merged: 11/10/2023
Merged by: @gaul
Base:
master← Head:fix_streamupload📝 Commits (1)
7222af8Fixed a bug in the re-upload part of Streamupload📊 Changes
3 files changed (+34 additions, -6 deletions)
View changed files
📝
src/fdcache_entity.cpp(+23 -2)📝
src/fdcache_fdinfo.cpp(+9 -2)📝
src/fdcache_fdinfo.h(+2 -2)📄 Description
Relevant Issue (if applicable)
n/a
Details
Problem phenomenon
The CI test was failing in rare cases in the
test_multipart_mixtest of StreamUpload.(It seemed to happen more often on
macosthan onlinux)StreamUpload logic
In StreamUpload, if the part range of each multipart is filled with updates, that part will be uploaded first without waiting for
flush.This StreamUpload logic allows for re-uploads of the same part if there are updates(written) to the same part range after the first upload for the same part.
In this case, when flushed the file, this part will be re-uploaded and the previous upload will be overwritten(cancelled).
This is the usual expected StreamUpload's logic.
Behavior in case of error
The error detected this time occurred in a case where Flush was called and a re-upload was started when the previously uploaded part had not yet finished uploading.
It means that uploads of the same part range were running at the same time.
Normally, the upload that started first will complete first, and the ETag value will be overwritten by the update caused by the re-upload.
However, on this error case, the re-upload process completed first, and the earlier upload process completed later, resulting in an invalid (cancelled) ETag value.
Fixed bug
In order to avoid this, we have modified it so that if it is detected that the part to be re-uploaded is still being uploaded, the re-upload will start after the upload including that part is completed.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.