-
Notifications
You must be signed in to change notification settings - Fork 3
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
Implement TTL #6
Comments
Here are all the features we should have for TTL -
During
During scheduled run (
Building on this change, we should also provide a way to apply TTL automatically. This can replace the current system, where which snaps will be deleted is determined at runtime; and instead we determine how long a snap will be kept at creation time. This should be tracked separately - added Issue #42. |
May I ask if the introduction of TTL (Time To Live) was to improve the granularity and flexibility in snapshot cleanup? Specifically, from cleaning within a fixed range for a certain source/configuration file to cleaning individual snapshots. This is my understanding of how the TTL feature is implemented; should there be no issues with this? |
Of course. First, just adding TTL will not change cleanup process, until we also implement #42. Just adding TTL will require it to be manually set, and will not interfere with the scheduled cleanup logic.
Here on, if I understand correctly, the question is on TTL based cleanup (issue #42). Let me first try to motivate why I am even thinking of TTL based cleanup. The current state has a problem - the logic is complicated. I.e. at a glance it is not possible to say which of the scheduled snapshots will be cleaned up in the next hour (or next 2 hours, or next day). This makes it tough to know, for example, that a useful snapshot that you identified will not be deleted soon.
You are right, it can get complex if we are not careful. Here's my proposal to keep it simple -
I.e. we keep TTL and the current scheduled cleanup logic disjoint, with TTL taking precedent. This should avoid all complexities or ambiguities. Please LMK if this seems alright, or if you see any problems. |
Interesting. Before issue #42 was released and before issue #6 was supplemented, I had read the implementation description of issue #6, at that time I did not know what difference it made compared to the existing planned cleanup. Now, out of curiosity, I asked for some clarification, and I learned what needs to be implemented within the scope of issue #6, as well as its significance. Thanks for your response!
I can accept its significance and have not noticed any issues so far. However, I believe that before implementing issue #6, we should first refresh the current project structure. |
Thank you for checking #6 and #42. I detailed the algorithm to be implemented for #42 can get tricky, so it is good to design it. I laid it out here. Rest of the comment is off topic to this issue #6, and deal with developmental practices. Anyone focused on this issue can feel free to skip.
I admit the decision is a carry forward from how Google organizes codes. I know there are pros and cons, and I will switch if I hear compelling reason. At the moment I like this way of organizing however, since it has a few very good advantages. I like this way of organizing for a few reasons however -
Would be grateful to know if there are any existing boundary conditions, and if so fix them.
It would help to know how you want to redesign the main. I am assuming you mean this code sample, #5 (comment)? If so, I am not 100% convinced of that change. I believe it is intended to replace the if-else routing logic in main().
The other big section in the main file is _parse_args(). Both currently seem to be good cognitive units. They are large code blocks, but readable and easy to understand. So in summary, I don't feel fully convinced that this particular restructuring will reduce complexity; in fact I feel concerned that it may increase it. What I would like however, is to move away from python's ArgumentParser, to something like typed-argument-parser. We will of course need to make sure that the change and argument parsing structure is entirely back-compatible so that we do not break any possibly existing user-scripts. |
There should be a way to specify TTL, either in config or via commandline (commandline takes precedence).
Any snaps beyond TTL should be considered as expired, and cleaned up on next scheduled run.
Snaps having TTL should show it on
yabsnap list
.The text was updated successfully, but these errors were encountered: