-
Notifications
You must be signed in to change notification settings - Fork 699
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
[CHANGED] PurgeDeletes() will now keep markers that are less than 30min old #906
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it, we should place under normal PurgeDeletes though IMO.
We can change over the WatchOpts possibly since I think we only use them for context here.
8accd34
to
2aa1139
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@derekcollison Yes, but we have a problem. This would work (ability to set the value) only in case where user calls CreateKeyValue(). For KeyValue() (lookup and bind), that won't work. So either we make it a kvs setter, or we pull Wally's PR (remove WatchOpt and add PurgeOpt) but then add the new logic with Keep:1. |
Good point. I would say for now remove option to set and we can see how things play out if folks really want to change it. Those tombstones are small so as long as we remove the history itself and keep them should be fine with default of 30mins to start. |
Ok, sounds good. I will keep it internally so that I can override for tests, but otherwise will not expose it. Argh... tests are in |
@derekcollison Ok, I have updated the PR by removing the option and move a test to nats package so I can override the 30min for the test. I also changed the PR's title to indicate the change in behavior (especially that it is not configurable atm). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@derekcollison @wallyqs I think it would make sense to bring Wallys changes (from the gist) so we can have "purge options" to replace "WatchOpt" because otherwise users could really break the PurgeDeletes() call, say by passing IncludeHistory, etc.. Also, it would be nice to be able to set the option of this threshold. |
…in old There is a breaking change where PurgeDeletes() accepts now a list of PurgeOpt, not WatchOpt. We needed from WatchOpt only the context, and as it standed, it was bad since user could have passed the IncludeHistory() option to PurgeDeletes(), which would likely "break" the functionality. Also, when invoking PurgeDeletes(), the delete markers than are older than a default of 30 minutes will be deleted, however more recent ones will be kept. The data is always removed, even if a marker is not. The user can change the 30 minutes threshold using a new purge option called DeleteMarkersOlderThan(duration). If set to -1, it restores the old behavior of deleting delete/purge markers, regardless of their age. Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
fd44bee
to
4afdb30
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@derekcollison @wallyqs Ok, last iteration I promise :-) I have taken Wally's changes (although I had to remove |
There is a breaking change where PurgeDeletes() accepts now a list
of PurgeOpt, not WatchOpt.
We needed from WatchOpt only the context, and as it standed, it was
bad since user could have passed the IncludeHistory() option to
PurgeDeletes(), which would likely "break" the functionality.
Also, when invoking PurgeDeletes(), the delete markers than are older than
a default of 30 minutes will be deleted, however more recent ones will
be kept. The data is always removed, even if a marker is not.
The user can change the 30 minutes threshold using a new purge
option called DeleteMarkersOlderThan(duration). If set to -1,
it restores the old behavior of deleting delete/purge markers,
regardless of their age.
Signed-off-by: Ivan Kozlovic ivan@synadia.com