Skip to content

NC | Lifecycle | Adjust expire/noncurrent state properties to GPFS flow + fix of 2 small bugs #8999

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

Merged

Conversation

romayalon
Copy link
Contributor

@romayalon romayalon commented Apr 29, 2025

Describe the Problem

GPFS flow still uses old inline state usage for maintaining expiration state.

Explain the Changes

  1. parse_candidates_from_gpfs_ilm_policy() - currently GPFS flow supports only expiration rule, but for modularity purposes checked the rule type and used it for setting/getting the rule state based on the type - expire/noncurrent.

  2. _set_rule_state() - updated the whole state while we are calling it for a specific action, therefore we should update only the relevant part and keep the existing state that is irrelevant to the action (expire/noncurrent).

  3. create_gpfs_candidates_files () - we were not skipping correctly buckets that don't have any bucket lifecycle configuration - added a check + continue for that.

  4. Refactoring - replaced this.lifecycle_run_status.buckets_statuses[bucket_json.name].rules_statuses[lifecycle_rule.id].state with a call to _get_rule_state() function where needed.

Issues: Fixed #xxx / Gap #xxx

  1. Unlreated Gap - during those tests I saw that sometimes mmapplypolicy doesn't return all 1500 objects that should be deleted. need further debugging.
  2. Unrelated Gap - if delete_candidates list contains more than 1000 objects (by having multiple actions) we need to check if it deletes them all.

Testing Instructions:

Manual tests on a GPFS machine -

  1. create account
  2. create 2 buckets that exports the paths -/mnt/gpfs0/romy/bucket1_storage/ and /mnt/gpfs0/romy/bucket2_storage/
  3. set bucket lifecycle rule on each bucket - expiry set to the past + prefix b
  4. create 1500 objects that should be deleted per expire rule -
    for i in $(seq 1 1500); do echo "blalalalla" > /mnt/gpfs0/romy/bucket1_storage/bav$i.txt ; done
  5. run the lifecycle process manually - noobaa-cli lifecycle --disable_service_validation --disable_runtime_validation --debug 5 &> lifecycle_logs1.logs
  6. check 3000 objects were deleted and check the logs for 2 delete cycles per bucket.
cat lifecycle_logs.logs | grep "calling delete"
Apr-30 8:36:17.147 [noobaa-cli/3735888]    [L0] core.manage_nsfs.nc_lifecycle:: process_rule: calling delete_multiple_objects, num of objects to be deleted 1000
Apr-30 8:36:17.148 [noobaa-cli/3735888]    [L0] core.manage_nsfs.nc_lifecycle:: process_rule: calling delete_multiple_objects, num of objects to be deleted 1000
Apr-30 8:36:21.343 [noobaa-cli/3735888]    [L0] core.manage_nsfs.nc_lifecycle:: process_rule: calling delete_multiple_objects, num of objects to be deleted 500
Apr-30 8:36:21.493 [noobaa-cli/3735888]    [L0] core.manage_nsfs.nc_lifecycle:: process_rule: calling delete_multiple_objects, num of objects to be deleted 500
  • Doc added/updated
  • Tests added

@romayalon romayalon force-pushed the romy-adjust-gpfs-flow-to-key-state-changes branch 2 times, most recently from 36cb254 to e630809 Compare April 29, 2025 10:27
@romayalon romayalon requested a review from nadavMiz April 29, 2025 16:51
@romayalon romayalon force-pushed the romy-adjust-gpfs-flow-to-key-state-changes branch from e630809 to db45770 Compare April 29, 2025 16:54
@romayalon romayalon force-pushed the romy-adjust-gpfs-flow-to-key-state-changes branch from db45770 to 9d36c09 Compare April 30, 2025 05:43
@romayalon romayalon changed the title NC | Lifecycle | Adjust expire/noncurrent state properties to GPFS flow NC | Lifecycle | Adjust expire/noncurrent state properties to GPFS flow + fix of 2 small bugs Apr 30, 2025
@romayalon romayalon force-pushed the romy-adjust-gpfs-flow-to-key-state-changes branch from 9d36c09 to f39c5f5 Compare April 30, 2025 05:54
Copy link
Contributor

@shirady shirady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
I raised a couple of questions and comments

@romayalon romayalon force-pushed the romy-adjust-gpfs-flow-to-key-state-changes branch 2 times, most recently from 7e105bc to c92c971 Compare April 30, 2025 06:45
Signed-off-by: Romy <35330373+romayalon@users.noreply.github.com>
@romayalon romayalon force-pushed the romy-adjust-gpfs-flow-to-key-state-changes branch from c92c971 to b66acc0 Compare April 30, 2025 06:54
@romayalon romayalon merged commit 7a18cdb into noobaa:master Apr 30, 2025
11 checks passed
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.

2 participants