Open
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
sjovdnbos
requested changes
Apr 4, 2019
docs/snapshots.md
Outdated
| - vDisk level: <> | ||
|
|
||
| ##### Examples: | ||
| # @todo more examples |
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 |
| return 'Snapshot for vDisk {0} ({1})'.format(self.vdisk_guid, ', '.join(prop_strings)) | ||
|
|
||
|
|
||
| class Bucket(object): |
Contributor
There was a problem hiding this comment.
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] |
Contributor
There was a problem hiding this comment.
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
sjovdnbos
requested changes
Apr 18, 2019
| """ | ||
| if consistency_first_on is None: | ||
| consistency_first_on = [] | ||
|
|
Contributor
There was a problem hiding this comment.
Do some typechecking here please
sjovdnbos
approved these changes
Apr 23, 2019
# Conflicts: # ovs/constants/vdisk.py # ovs/lib/generic.py # ovs/lib/tests/generic_tests/test_snapshot.py
sjovdnbos
approved these changes
May 3, 2019
# Conflicts: # ovs/lib/generic.py # ovs/lib/tests/generic_tests/test_snapshot.py
sjovdnbos
approved these changes
May 23, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.