Repository navigation
Backup: tar bei geänderter Datei während des Lesens wiederholen - #4366
Open
seaspotter wants to merge 1 commit into
Open
seaspotter wants to merge 1 commit into
seaspotter wants to merge 1 commit into
Conversation
Linked issuesChecked at commit f614a32 #4342 [BUG] 2.3.0 automatische Backups weren nicht mehr durchgeführt, manuelle funktionieren · 1 of 1 met
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="runs/backup.sh" line_range="254-257" />
<code_context>
+ local attempt
+ for attempt in 1 2 3; do
+ tarStatus=0
+ tar_create || tarStatus=$?
+ ((tarStatus == 1)) || break
+ echo "warning: tar reported a file that changed while reading (attempt $attempt of 3)"
+ done
+ if ((tarStatus == 1)); then
+ echo "warning: continuing with the last archive, a file changed while it was read"
</code_context>
<issue_to_address>
**Concurrent backups overwrite each other**
When two backup requests overlap and choose the same filename, a second backup process can write the same `BACKUPFILE` while the first is retrying; the first retry recreates that path, so either process can append, checksum, or compress the other’s archive and return a misleading success or a missing file.
Serialize backup runs or give each process a unique temporary archive path and publish it only after the complete backup succeeds.
</issue_to_address>
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.
tarbeendet sich mit Status 1, wenn sich eine Datei während des Lesens ändert. Das passiert beim Tageslog (data/daily_log), das alle 5 Minuten neu geschrieben wird. Wegenset -ebricht dann das ganze Backup ab ("backup failed at line 225"), obwohl das Archiv fertig erstellt wurde. Das Verhalten ist in #4342 beschrieben.Änderungen:
Fixes #4342
Summary by Sourcery
Make backups resilient to files changing during tar archive creation without masking genuine archive errors.
Bug Fixes:
Enhancements: