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

feat: Dump retention managemnt #201

Merged
merged 1 commit into from
Sep 18, 2024
Merged

feat: Dump retention managemnt #201

merged 1 commit into from
Sep 18, 2024

Conversation

wwoytenko
Copy link
Contributor

@wwoytenko wwoytenko commented Sep 18, 2024

Introduced retention parameters for the delete command. The delete command now supports the following retention parameters:

  • --dry-run: Runs the deletion operation in test mode with verbose output, without actually deleting anything.
  • --before-date 2024-08-27T23:50:54+00:00: Deletes dumps older than the specified date. The date must be provided in RFC3339Nano format, for example: 2021-01-01T00:00:00Z.
  • --retain-recent 10: Retains the N most recent dumps, where N is specified by the user.
  • --retain-for 1w2d3h4m5s6ms7us8ns: Retains dumps for the specified duration. The format supports weeks (w), days (d), hours (h), minutes (m), seconds (s), milliseconds (ms), microseconds (us), and nanoseconds (ns).
  • --prune-failed: Prunes (removes) all dumps that have failed.
  • --prune-unsafe: Prunes dumps with "unknown-or-failed" statuses. This option only works in conjunction with --prune-failed.

Refactored code and implemented helper functions to support the new features.

Introduced two new statuses: failed and in progress. A dump is considered failed if it lacks a "done" heartbeat or if the last heartbeat timestamp exceeds 30 minutes. Heartbeats are recorded every 15 minutes by the dump command while it is in progress. If greenmask fails unexpectedly, the dump is marked as failed if the heartbeat is not finalized. The in progress status indicates that a dump is still in progress.

The heartbeat mechanism determines dump status by storing a heartbeat file in the associated dump storage path, which is updated every 15 minutes. If the heartbeat is not updated for more than 30 minutes (twice the interval), the dump is classified as failed.

Revised docs.

Closes #142

Introduced retention parameters for the delete command. The delete command now supports the following retention parameters:

- dry-run: Runs the deletion operation in test mode with verbose output, without actually deleting anything.
- --before-date 2024-08-27T23:50:54+00:00: Deletes dumps older than the specified date. The date must be provided in RFC3339Nano format, for example: 2021-01-01T00:00:00Z.
- --retain-recent 10: Retains the N most recent dumps, where N is specified by the user.
- --retain-for 1w2d3h4m5s6ms7us8ns: Retains dumps for the specified duration. The format supports weeks (w), days (d), hours (h), minutes (m), seconds (s), milliseconds (ms), microseconds (us), and nanoseconds (ns).
- --prune-failed: Prunes (removes) all dumps that have failed.
- --prune-unsafe: Prunes dumps with "unknown-or-failed" statuses. This option only works in conjunction with --prune-failed.

Refactored code and implemented helper functions to support the new features.

Introduced two new statuses: `failed` and `in progress`. A dump is considered `failed` if it lacks a "done" heartbeat or if the last heartbeat timestamp exceeds 30 minutes. Heartbeats are recorded every 15 minutes by the dump command while it is in progress. If `greenmask` fails unexpectedly, the dump is marked as `failed` if the heartbeat is not finalized. The `in progress` status indicates that a dump is still in progress.

The heartbeat mechanism determines dump status by storing a heartbeat file in the associated dump storage path, which is updated every 15 minutes. If the heartbeat is not updated for more than 30 minutes (twice the interval), the dump is classified as `failed`.

Revised docs.
@wwoytenko wwoytenko self-assigned this Sep 18, 2024
@wwoytenko wwoytenko changed the title feat: Delete old dumps except for the last X feat: Dump retention managemnt Sep 18, 2024
@wwoytenko wwoytenko merged commit c10ff17 into main Sep 18, 2024
13 checks passed
@wwoytenko wwoytenko deleted the feat/delete_last_x_dumps branch October 9, 2024 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delete old dumps except for the last X
1 participant