ItemInfo: add mtime field (storage-side modification timestamp) - #212
Merged
Merged
Conversation
Add an mtime field to ItemInfo: the last modification UNIX timestamp, stamped by the *storage side's* clock, 0 if unknown. - posixfs: st_mtime (free, stat is already fetched) - sftp: st_mtime from SFTPAttributes (already on the wire); also plumb the previously-missing atime - s3: LastModified (stamped by the S3 service) - rest: new X-BorgStore-Mtime header (HEAD) and "mtime" JSON key (list); old servers without it degrade to 0 on the client side - rclone: stays 0 - rclone's ModTime is a client-supplied timestamp preserved across upload, not a storage-side clock reading, and fetching it would cost extra per-object metadata reads on some remotes (noModTime stays True) The field enables clients to compare timestamps across writers in the storage's clock domain, e.g. borg's clock-skew handling for repository locks (borgbackup/borg#9870). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Add an
mtimefield toItemInfo: the last modification UNIX timestamp, stamped by the storage side's clock, 0 if unknown.st_mtime(free, the stat is already fetched)st_mtimefromSFTPAttributes(already on the wire); also plumbs the previously-missing atimeLastModified(stamped by the S3 service)X-BorgStore-Mtimeheader (HEAD) and"mtime"JSON key (list); old servers without it degrade to 0 on the client sidenoModTimestaysTrue)The field lets clients compare timestamps across writers within the storage's clock domain, e.g. borg's clock-skew handling for repository locks (borgbackup/borg#9870). Targets a 0.6.1 release (the borg PR pins
~= 0.6.1).The mtime field is appended after atime with a default of 0, so positional construction with fewer fields keeps working.
Tests: full suite passes locally (265 passed / 12 skipped), incl. new mtime assertions for posixfs and the rest server/client.
🤖 Generated with Claude Code