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

NSFS | S3 | Versioning: Threaded delete of multiple objects does not delete #8377

Closed
hseipp opened this issue Sep 17, 2024 · 0 comments · Fixed by #8388
Closed

NSFS | S3 | Versioning: Threaded delete of multiple objects does not delete #8377

hseipp opened this issue Sep 17, 2024 · 0 comments · Fixed by #8388

Comments

@hseipp
Copy link

hseipp commented Sep 17, 2024

Environment info

Actual behavior

With the following test code, all delete_objects commands return, but the objects are still present afterwards:

    def test_versioning_concurrent_multi_object_delete():
        num_objects = 5
        num_threads = 5
        bucket_name = get_new_bucket()
    
        check_configure_versioning_retry(bucket_name, "Enabled", "Enabled")
    
        key_names = ["key_{:d}".format(x) for x in range(num_objects)]
        bucket = _create_objects(bucket_name=bucket_name, keys=key_names)
    
        client = get_client()
        versions = client.list_object_versions(Bucket=bucket_name)['Versions']
        assert len(versions) == num_objects
        objs_dict = {'Objects': [dict((k, v[k]) for k in ["Key", "VersionId"]) for v in versions]}
        results = [None] * num_threads
    
        def do_request(n):
            results[n] = client.delete_objects(Bucket=bucket_name, Delete=objs_dict)
    
        t = []
        for i in range(num_threads):
            thr = threading.Thread(target = do_request, args=[i])
            thr.start()
            t.append(thr)
        _do_wait_completion(t)
    
        for response in results:
            assert len(response['Deleted']) == num_objects
            assert 'Errors' not in response
    
        response = client.list_objects(Bucket=bucket_name)
>       assert 'Contents' not in response
E       assert 'Contents' not in {'Contents': [{'ETag': '"mtime-d48pnbhmvi0w-ino-15hc"', 'Key': 'key_0', 'LastModified': datetime.datetime(2024, 9, 17,..., 'ID': '66e85c103a034ad6a392511e'}, ...}], 'Delimiter': 'undefined', 'EncodingType': 'url', 'IsTruncated': False, ...}

Expected behavior

Test code passes and all objects get properly deleted.

Steps to reproduce

Execute the above test code as part of Ceph s3-tests.

More information - Screenshots / Logs / Other output

Noobaa log with "all" log level attached
noobaa_20240917_2.log.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants