Skip to content
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

NC | NSFS | Versioning | Fix Bug 8333 | Delete Object with Version ID | GPFS #8345

Merged

Conversation

shirady
Copy link
Contributor

@shirady shirady commented Sep 11, 2024

Explain the changes

  1. Change the calls of native_fs_utils.safe_unlink that are used gpfs_options as it was received from _open_files_gpfs which can return an object with property delete_version or an object with 2 properties move_to_versions and move_to_dst, hence when using this returned object to the function native_fs_utils.safe_unlink the argument gpfs_options should an object with the properties src_file and dir_file.

Issues: Fixed #8333

  1. Currently, on GPFS when using the delete-object with version ID there is an error, in the logs, we can see:

core.util.native_fs_utils:: safe_unlink: dir_file is undefined, cannot use it to call safe_unlink_gpfs

Testing Instructions:

  1. Not yet, it Should be tested on a GPFS machine.
  • Doc added/updated
  • Tests added

@shirady shirady self-assigned this Sep 11, 2024
@shirady shirady force-pushed the nsfs-nc-versioning-delete-object-with-object-id branch from 61ba309 to 3b602ab Compare September 11, 2024 07:14
@shirady shirady changed the title NC | NSFS | Versioning | Fix Bug 8333 | Delete Object with Version ID NC | NSFS | Versioning | Fix Bug 8333 | Delete Object with Version ID | GPFS Sep 12, 2024
Copy link
Contributor

@romayalon romayalon left a comment

Choose a reason for hiding this comment

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

LGTM, but let's not merge it until it's tested on GPFS

@romayalon
Copy link
Contributor

@shirady can you add a test to test_nsfs_versioning_gpfs.js?

@shirady
Copy link
Contributor Author

shirady commented Sep 18, 2024

Validation on GPFS cluster:

I used this RPM: noobaa-core-5.18.0-20240917-nsfs-nc-versioning-fixes.el9.x86_64.rpm
Which was created from this branch: nsfs-nc-versioning-fixes

Cluster node:

  1. We created an account using noobaa-cli: noobaa-cli account add --name s3user-5001 --uid 5001 --gid 5001 --new_buckets_path /ibm/fs1/teams/ (note new_buckets_path is running on GPFS, you can run df -T /ibm/fs1/teams/)

Client node:
2. Created the alias s3-u1='AWS_ACCESS_KEY_ID=<access-key> AWS_SECRET_ACCESS_KEY=<secret-key> aws --no-verify-ssl --endpoint https://1<ip-address-of-node>:6443/ --no-verify-ssl'
3. create a bucket: s3-u1 s3 mb s3://user-5001-b02; echo $?

make_bucket: user-5001-b02
0
  1. versioning enabled: s3-u1 s3api put-bucket-versioning --bucket user-5001-b02 --versioning-configuration Status=Enabled and then s3-u1 s3api get-bucket-versioning --bucket user-5001-b02
{
    "Status": "Enabled"
}
  1. put an object (save the version-id): s3-u1 s3api put-object --bucket user-5001-b02 --key hello.txt
{
    "ETag": "\"mtime-d49fqckqr9c0-ino-1r7l\"",
    "VersionId": "mtime-d49fqckqr9c0-ino-1r7l"
}
  1. delete object with version-id: s3-u1 s3api delete-object --bucket user-5001-b02 --key hello.txt --version-id <version-id>
{
    "VersionId": "mtime-d49fqckqr9c0-ino-1r7l"
}

From the logs (/var/log/messages): You can see the return code 204 (success)

Sep 18 06:14:41 tmtscalets-protocol-1 node[1501925]: Sep-18 6:14:41.486 [nsfs/1501925] [L1] core.util.http_utils:: HTTP REPLY EMPTY DELETE /user-5001-b02/hello.txt?versionId=mtime-d49fqckqr9c0-ino-1r7l (removed from printing) 204

Outputs are as expected, no errors.
@romayalon @nadavMiz

1. Change the calls of native_fs_utils.safe_unlink that are used gpfs_options as it was received from _open_files_gpfs which can return an object with property delete_version or an object with 2 properties move_to_versions and move_to_dst, hence when using this returned object to the function native_fs_utils.safe_unlink the argument gpfs_options should an object with the properties src_file and dir_file.

Signed-off-by: shirady <[email protected]>
@shirady shirady force-pushed the nsfs-nc-versioning-delete-object-with-object-id branch from c346aa4 to c65039b Compare September 18, 2024 14:33
@shirady shirady merged commit 1325975 into noobaa:master Sep 18, 2024
10 checks passed
@shirady shirady deleted the nsfs-nc-versioning-delete-object-with-object-id branch September 18, 2024 16:12
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.

NSFS | S3 | Versioning: Internal error returned by DeleteObject with versionId.
2 participants