Skip to content

Fix last_n keep rule (#691) - #750

Merged
problame merged 2 commits into
zrepl:masterfrom
dsh2dsh:fix-keep-n
Dec 22, 2023
Merged

problame merged 2 commits into
zrepl:masterfrom
dsh2dsh:fix-keep-n

Conversation

@dsh2dsh

@dsh2dsh dsh2dsh commented Oct 18, 2023

Copy link
Copy Markdown
Contributor

From #691

The last_n prune rule keeps everything, regardless of if it matches the regex or not, if there are less than count snapshot. The expectation would be to never keep non-regex snapshots, regardless of number.

Fron zrepl/zrepl#691

The last_n prune rule keeps everything, regardless of if it matches the regex or
not, if there are less than count snapshot. The expectation would be to never
keep non-regex snapshots, regardless of number.

@problame problame left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this contribution, and sorry for the late reply!

This PR is correct, and in line what the docs always said.

Usually with this kind of change there's risk about existing setups relying on the bug, but, with this one, I can't see a problem. So, let's just fix it.

I'd love for more tet coverage. Can you add ad additional test case that fails without this PR and works with this PR?

Comment thread pruning/keep_last_n_test.go Outdated
@dsh2dsh

dsh2dsh commented Nov 2, 2023

Copy link
Copy Markdown
Contributor Author

Can you add ad additional test case that fails without this PR and works with this PR?

Already done. This line

MustKeepLastN(4, "a")

tests it.

@problame
problame merged commit ebc46cf into zrepl:master Dec 22, 2023
@problame

Copy link
Copy Markdown
Member

Thanks again, and sorry for the long delay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants