mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-25 13:26:00 +03:00
[GH-ISSUE #2581] [Data Corruption]File is truncated with padding-zeros after backend server restarted #1240
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#1240
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?
Originally created by @hbao0915 on GitHub (Oct 30, 2024).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/2581
Additional Information
Version of s3fs being used (
s3fs --version)v1.87, v1.91, v1.95
Details about issue
The issue description in short: s3fs is opening and reading file while S3 server is restarted, file could be truncated with padding zeroes, which causes data corruption.
I tracked the code, and found that the bug is in this stack: s3fs_open -> check_object_access -> get_object_attribute
Inside
get_object_attribute, if an HEAD with 503 response (or other 5xx resp, or timeout err) would be returned because of backend being down for a while, then s3fs tries to send HEAD with filename plus "_$folder$". If the backend server recovers now, a 404 resp will be returned. Then s3fs consider the file not existing, and s3fs would call FdManager::Open with st.size=0, which will result in file being truncated.