You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
revisions purge skips POSIXFS revisions with whole-second timestamps #3931
On POSIXFS, opencloud revisions purge fails to detect valid revision filenames without fractional seconds, including numbered revisions:
*.REV.2022-10-14T10:42:55Z
*.REV.2022-10-14T10:42:55Z.1
The regex in opencloud/pkg/revisions/revisions.go requires fractional seconds, although POSIXFS can create revisions without them and append .1, .2, etc. for timestamp collisions.
Steps to reproduce
Use POSIXFS and upload/overwrite files with whole-second modification timestamps, e.g. through WebDAV.
Confirm that .oc-nodes contains revisions with the filenames above.
In opencloud/pkg/revisions/revisions.go, make the fraction in _versionRegex optional: \.REV\.[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?Z. Glob, GlobWorkers, Walk and PurgeRevisions all use it, so one change covers them.
The .1 / .2 collision suffix then falls into the default (revision) branch of PurgeRevisions, so no change there. Add the whole-second and numbered forms to the comment above the regex.
Tests in revisions_test.go: X.REV.2022-10-14T10:42:55Z, ...Z.1 and ...Z.mpk are found by the glob/walk paths and counted by a PurgeRevisions dry run.
Must not change: the existing fractional-second cases, and a name like X.REV.garbage is still ignored.
go test ./opencloud/pkg/revisions/....
Open question: should the regex match the .N suffix explicitly, or is "anything after Z" fine like today?
Activity
RyoKusnadi commentedon Nov 12, 2026
Hi @Sympatron @aduffeck, can I do it?
How I plan to do it:
opencloud/pkg/revisions/revisions.go, make the fraction in_versionRegexoptional:\.REV\.[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?Z.Glob,GlobWorkers,WalkandPurgeRevisionsall use it, so one change covers them..1/.2collision suffix then falls into the default (revision) branch ofPurgeRevisions, so no change there. Add the whole-second and numbered forms to the comment above the regex.revisions_test.go:X.REV.2022-10-14T10:42:55Z,...Z.1and...Z.mpkare found by the glob/walk paths and counted by aPurgeRevisionsdry run.X.REV.garbageis still ignored.go test ./opencloud/pkg/revisions/....Open question: should the regex match the
.Nsuffix explicitly, or is "anything afterZ" fine like today?