]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: swift: generate obj instance name while copying versioned objects 25473/head
authorAbhishek Lekshmanan <abhishek@suse.com>
Mon, 10 Dec 2018 16:15:53 +0000 (17:15 +0100)
committerAbhishek Lekshmanan <abhishek@suse.com>
Mon, 10 Dec 2018 16:15:53 +0000 (17:15 +0100)
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/rgw/rgw_rados.cc

index 8c8a08588b09f5971ee2888b74204ffe162541a3..6e2158772bff65e2f84529c5e9d7324857d4d1a4 100644 (file)
@@ -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<std::string, ceph::bufferlist> 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);