Skip to content

NC | lifecycle | _parse_key_from_line remove redundant / at the beginning of the file key #9022

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
merged 1 commit into from
May 13, 2025

Conversation

romayalon
Copy link
Contributor

@romayalon romayalon commented May 13, 2025

Describe the Problem

If bucket path is configured without trailing '/', _parse_key_from_line() return a key that contained starting '/' which caused an error when trying to delete the object due to re-check of the prefix.

Explain the Changes

  1. On _parse_key_from_line() - Added trailing '/' when removing the bucket path.

Issues: Fixed #xxx / Gap #xxx

  1. Gap - add auto tests

Testing Instructions:

  1. Manual -
  2. create a bucket configured with a path without a trailing /.
noobaa-cli bucket update --name bucket10 --path /mnt/gpfs0/romy/demo/bucket10
mkdir /mnt/gpfs0/romy/demo/bucket10/data/
for i in {1..10} ; do touch -d  "10 days ago"  /mnt/gpfs0/romy/demo/bucket10/logs/file${i}.txt ; done
noobaa-cli lifecycle --disable_runtime_validation

// if bug was reproduced expect to see the following output - 
"bucket10": {
          "bucket_process_times": {
            "process_bucket_start_time": 1747122262442,
            "process_bucket_end_time": 1747122262691,
            "process_bucket_took_ms": 249
          },
          "bucket_stats": {
            "num_objects_deleted": 0,
            "num_objects_delete_failed": 20,
            "objects_delete_errors": [
              {
                "err_code": "FILTER_MATCH_FAILED",
                "err_message": "file_matches_filter lifecycle - filter on file returned false /logs/file7.txt"
              },
              {
                "err_code": "FILTER_MATCH_FAILED",
                "err_message": "file_matches_filter lifecycle - filter on file returned false /logs/file9.txt"
              },
              {
                "err_code": "FILTER_MATCH_FAILED",
                "err_message": "file_matches_filter lifecycle - filter on file returned false /logs/file6.txt"
              },
              {
                "err_code": "FILTER_MATCH_FAILED",
                "err_message": "file_matches_filter lifecycle - filter on file returned false /logs/file5.txt"
              },
              {
                "err_code": "FILTER_MATCH_FAILED",
                "err_message": "file_matches_filter lifecycle - filter on file returned false /logs/file2.txt"
              },
              {
                "err_code": "FILTER_MATCH_FAILED",
                "err_message": "file_matches_filter lifecycle - filter on file returned false /logs/file4.txt"
              },
              {
                "err_code": "FILTER_MATCH_FAILED",
....
}
  • Doc added/updated
  • Tests added

@romayalon romayalon requested a review from nadavMiz May 13, 2025 08:07
@romayalon romayalon merged commit de301b6 into noobaa:master May 13, 2025
11 checks passed
@romayalon romayalon mentioned this pull request May 15, 2025
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