-
Notifications
You must be signed in to change notification settings - Fork 23
Custom retention policy #2285
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
base: 2.9.x
Are you sure you want to change the base?
Custom retention policy #2285
Conversation
Defaults to: One per hour first day, one per day first week, one per week first month, one older. Will read `ovs/framework/scheduling/retention_policy/<vdisk_guid>` for config if different intervals are passed, and will fall back to default if none provided. Todo: -Make unittest pass -Check if config file is in correct format.
Skip the first 24hours when scheduling the task to allow the user to create and use snapshots
Added documentation Extra checks added to the scheduled task to prevent the policy being enacted on a wrong timestamp
Assertion only triggers on non-unittest environment
docs/snapshots.md
Outdated
- vDisk level: <> | ||
|
||
##### Examples: | ||
# @todo more examples |
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.
Work out todo
ovs/lib/helpers/generic/snapshots.py
Outdated
one snapshot per hour the first day | ||
one snapshot per day the rest of the week | ||
one snapshot per week the rest of the month | ||
one older snapshot snapshot will always be stored for an interval older then the longest interval passed in the config |
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.
This is outdated
return 'Snapshot for vDisk {0} ({1})'.format(self.vdisk_guid, ', '.join(prop_strings)) | ||
|
||
|
||
class Bucket(object): |
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.
Add some more docstrings/typing for this class and its functions.
ovs/lib/helpers/generic/snapshots.py
Outdated
oldest = snapshot | ||
snapshot_to_keep = oldest | ||
_logger.debug('Elected {} as the snapshot to keep within {}.'.format(snapshot_to_keep, self)) | ||
obsolete_snapshots = [s for s in self.snapshots if s.timestamp != snapshot_to_keep.timestamp] |
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.
you can just compare snapshots here, instead of checking timestamps, right?
[s for s in self.snapshots if s != snapshot_to_keep
]
Add API to configure the retention policy
""" | ||
if consistency_first_on is None: | ||
consistency_first_on = [] | ||
|
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.
Do some typechecking here please
# Conflicts: # ovs/constants/vdisk.py # ovs/lib/generic.py # ovs/lib/tests/generic_tests/test_snapshot.py
# Conflicts: # ovs/lib/generic.py # ovs/lib/tests/generic_tests/test_snapshot.py
No description provided.