]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: get bucket markers from the same object at all times
authorGreg Farnum <gregory.farnum@dreamhost.com>
Mon, 26 Sep 2011 22:11:25 +0000 (15:11 -0700)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Mon, 26 Sep 2011 22:11:25 +0000 (15:11 -0700)
We use an object in the control pool here, rather than an object
local to each pool. This gives us a single value which can be used
for tracking data at all times.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/rgw/rgw_rados.cc

index dc0524c02884789ee94de9b8f4b98bb798dc831c..1736536002c265ae2ca81b30a5dc08bbee50a93a 100644 (file)
@@ -309,7 +309,7 @@ int RGWRados::create_bucket(std::string& id, rgw_bucket& bucket, map<std::string
   }
 
   if (assign_marker) {
-    librados::IoCtx io_ctx;
+    librados::IoCtx io_ctx; // context for new bucket
 
     int r = open_bucket_ctx(bucket, io_ctx);
     if (r < 0)
@@ -319,11 +319,11 @@ int RGWRados::create_bucket(std::string& id, rgw_bucket& bucket, map<std::string
     uint32_t nop = 0;
     ::encode(nop, bl);
 
-    r = io_ctx.write(bucket_marker_ver_oid, bl, bl.length(), 0);
+    r = control_pool_ctx.write(bucket_marker_ver_oid, bl, bl.length(), 0);
     if (r < 0)
       return r;
 
-    uint64_t ver = io_ctx.get_last_version();
+    uint64_t ver = control_pool_ctx.get_last_version();
     RGW_LOG(0) << "got obj version=" << ver << dendl;
     char buf[32];
     snprintf(buf, sizeof(buf), "%llu", (unsigned long long)ver);