fix: scheduled forget never runs for repos that only receive external snapshots - #1285
Open
dobbry-vechur wants to merge 1 commit into
Open
Conversation
dobbry-vechur
force-pushed
the
fix/scheduled-forget-external-snapshots
branch
2 times, most recently
from
July 8, 2026 20:32
6610265 to
4a9f4a0
Compare
garethgeorge
force-pushed
the
main
branch
3 times, most recently
from
July 10, 2026 09:45
1a75a0a to
aeade74
Compare
Author
|
@garethgeorge sorry to bother, but wdyt? |
Owner
|
Hi, appreciate the interest in contributing a fix here! Sorry for the late reply -- I've gone ahead and removed the shouldSkip behavior which is yielding merge conflicts, but I'm happy to merge the change to the Next() defn with merge conflicts resolved |
|
I've just hit this issue - @dobbry-vechur anything I can do to support resolving the merge-conflicts? |
Author
|
Hey @PixelJonas I'll make sure to update this PR today. |
- count live indexed snapshots as activity in ScheduledForgetTask.Next - rename foundBackup to foundActivity - drop default instance ID filter in testTaskRunner.QueryOperations - add scheduled forget cases to TestScheduling
dobbry-vechur
force-pushed
the
fix/scheduled-forget-external-snapshots
branch
from
August 1, 2026 18:56
4a9f4a0 to
20414d5
Compare
Author
|
@garethgeorge - updated, resolved conflicts, should be ready for merge. |
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.
If a repo only receives snapshots created outside backrest, the scheduled forget never becomes due. My setup: rest-server on the backrest machine, laptop pushes restic backups to it, backrest handles retention with a repo-level forget policy.
External snapshots never produce an
OperationBackup. The indexer records them asOperationIndexSnapshot. ThefoundBackupscan inNextonly looked atOperationBackup, so an external-only repo always looks idle. WithCLOCK_LAST_RUN_TIMEthat resets the schedule base to now when it sees no backups, so restarts and config changes kept pushing the run out.Fix: count a live (
Forgot == false)OperationIndexSnapshotas activity. Index ops are timestamped from the snapshot's own time, so they slot into the scan the same way backup ops do.Also dropped a default instance-ID filter that
testTaskRunner.QueryOperationswas adding but prodtaskRunnerImpldoesn't. It would have hidden unassociated ops from the regression test, sinceNext's query is deliberately instance-unscoped. Neutral for existing tests, they all seed ops with the config instance ID.Tests: four scheduled-forget cases in
TestScheduling. The indexed-snapshot case fails on main.