]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: bucket meta remove don't overwrite entry point first
authorYehuda Sadeh <yehuda@inktank.com>
Mon, 19 Aug 2013 23:56:27 +0000 (16:56 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Fri, 23 Aug 2013 17:10:57 +0000 (10:10 -0700)
Fixes: #6056
When removing a bucket metadata entry we first unlink the bucket
and then we remove the bucket entrypoint object. Originally
when unlinking the bucket we first overwrote the bucket entrypoint
entry marking it as 'unlinked'. However, this is not really needed
as we're just about to remove it. The original version triggered
a bug, as we needed to propagate the new header version first (which
we didn't do, so the subsequent bucket removal failed).

Reviewed-by: Greg Farnum <greg@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_bucket.cc

index 1e523f332cf3265ef314414a5d4ca865e3ee3cd7..5356417f09ab53e754c9e019788ad9f2112953a0 100644 (file)
@@ -1451,7 +1451,12 @@ public:
     if (ret < 0)
       return ret;
 
-    ret = rgw_unlink_bucket(store, be.owner, entry);
+    /*
+     * We're unlinking the bucket but we don't want to update the entrypoint here — we're removing
+     * it immediately and don't want to invalidate our cached objv_version or the bucket obj removal
+     * will incorrectly fail.
+     */
+    ret = rgw_unlink_bucket(store, be.owner, entry, false);
     if (ret < 0) {
       lderr(store->ctx()) << "could not unlink bucket=" << entry << " owner=" << be.owner << dendl;
     }