NC | lifecycle | expire objects with batching #8897
Merged
+266
−52
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.
Describe the Problem
we populate the delete candidates in memory which might cause issues when the delete candidates list very large. also we want to promote fairness between the lifecycle rules, so one process / bucket will not take most of the processing time. this PR adds populating expiry candidates with batching so we process NC_LIFECYCLE_LIST_BATCH_SIZE of objects each time for every rule in a loop. there is also a loop between bucket so a bucket will process only NC_LIFECYCLE_BUCKET_BATCH_SIZE objects each time
Explain the Changes
Issues: Gaps
Testing Instructions:
manual testing:
sudo cat /var/log/noobaa/lifecycle/lifecycle_run_<timetamp>.json
) should show state of all buckets and rules withis_finished = true
. in case run finished before all objects were processed, state should include key_marker or where the rule last stopped. you can make the process end prematurely by settingNC_LIFECYCLE_TIMEOUT_MS
in the timeout to be a small enough value so the run will not finish, but high enough value so at least on cycle will finish (one list-object operation)