Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Smart Remove behavior to really "keep one snapshot per week for n weeks" #1819

Draft
wants to merge 6 commits into
base: dev
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions common/snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,7 @@ def smartRemoveKeepAll(self,
min_id = SID(min_date, self.config)
max_id = SID(max_date, self.config)

logger.debug("Keep all >= %s and < %s" %(min_id, max_id), self)
logger.debug("Keep all >= %s and < %s" %(min_id.withoutTag, max_id.withoutTag), self)

return set([sid for sid in snapshots if sid >= min_id and sid < max_id])

Expand Down Expand Up @@ -1562,7 +1562,7 @@ def smartRemoveKeepFirst(self,
min_id = SID(min_date, self.config)
max_id = SID(max_date, self.config)

logger.debug("Keep first >= %s and < %s" %(min_id, max_id), self)
logger.debug("Keep first >= %s and < %s" %(min_id.withoutTag, max_id.withoutTag), self)

for sid in snapshots:
# try to keep the first healthy snapshot
Expand Down Expand Up @@ -1683,7 +1683,7 @@ def smartRemoveList(self,
keep |= self.smartRemoveKeepFirst(
snapshots,
d,
d + datetime.timedelta(days=8),
d + datetime.timedelta(days=7),
keep_healthy=True)
d -= datetime.timedelta(days=7)

Expand Down