From 7515bae393075edff3a4b351bcbcf7376c3fb617 Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Mon, 10 Dec 2018 17:15:53 +0100 Subject: [PATCH] rgw: swift: generate obj instance name while copying versioned objects Signed-off-by: Abhishek Lekshmanan --- src/rgw/rgw_rados.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 8c8a08588b09..6e2158772bff 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -3340,6 +3340,11 @@ int RGWRados::swift_versioning_copy(RGWObjectCtx& obj_ctx, } rgw_obj dest_obj(dest_bucket_info.bucket, buf); + + if (dest_bucket_info.versioning_enabled()){ + gen_rand_obj_instance_name(&dest_obj); + } + obj_ctx.set_atomic(dest_obj); string no_zone; @@ -3427,6 +3432,11 @@ int RGWRados::swift_versioning_restore(RGWSysObjectCtx& sysobj_ctx, std::map no_attrs; rgw_obj archive_obj(archive_binfo.bucket, entry.key); + + if (bucket_info.versioning_enabled()){ + gen_rand_obj_instance_name(&obj); + } + obj_ctx.set_atomic(archive_obj); obj_ctx.set_atomic(obj); -- 2.47.3