Use mtime-based files cache default on Windows#9530
Open
hiijoshi wants to merge 1 commit intoborgbackup:masterfrom
Open
Use mtime-based files cache default on Windows#9530hiijoshi wants to merge 1 commit intoborgbackup:masterfrom
hiijoshi wants to merge 1 commit intoborgbackup:masterfrom
Conversation
src/borg/archiver/create_cmd.py
Outdated
Comment on lines
+229
to
+233
| if is_win32 and "ctime" in str(args.files_cache_mode): | ||
| logger.warning( | ||
| "Using ctime on Windows may not detect file changes correctly. " | ||
| "Consider using mtime-based cache mode." | ||
| ) |
Member
There was a problem hiding this comment.
If you do it like that, it will emit a warning, but then it will continue and use ctime, although we know that this won't work.
Author
There was a problem hiding this comment.
Thanks, that makes sense. A warning alone would still continue with an unreliable ctime-based mode on Windows. I’ve removed that part and kept this PR focused on switching the default files-cache mode on Windows to an mtime-based mode, while leaving non-Windows behavior unchanged.
1848149 to
b6e5033
Compare
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.
Summary
Fix default files-cache mode on Windows.
On Windows,
ctimerepresents file creation time rather than inode change time. Usingctimein the default files-cache mode can therefore fail to detect modified files correctly.Changes
mtime-based files cache mode on Windowsctime,size,inodedefault behavior unchanged on POSIX systemsReasoning
This aligns with the issue discussion and ensures more reliable change detection on Windows systems.
Testing
Additional Improvement
Also added a warning when using ctime-based files cache mode on Windows, since ctime represents file creation time and may not detect file changes correctly.
Fixes #7193