]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: pass num shards on bucket initialization
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 9 Dec 2014 21:58:09 +0000 (13:58 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Wed, 14 Jan 2015 03:21:27 +0000 (19:21 -0800)
Need to pass the actual num shards that are going to be used for this
specific bucket. Bucket may be created by applying metadata from
different zone, so num shards might be different.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_bucket.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index 3b178dac43c7eb2a25fb86e187c3a25735ed6025..48abc4d72e66fb535d244529e9b3937d6c680a60 100644 (file)
@@ -1728,7 +1728,7 @@ public:
 
     objv_tracker = bci.info.objv_tracker;
 
-    ret = store->init_bucket_index(bci.info.bucket);
+    ret = store->init_bucket_index(bci.info.bucket, bci.info.num_shards);
     if (ret < 0)
       return ret;
 
index 2f18f73142d061bbd002e9fc304061c5421c17ac..6ab472a2fb4c1f3a72b56fd270a0f64830872787 100644 (file)
@@ -2375,7 +2375,7 @@ int RGWRados::create_pool(rgw_bucket& bucket)
   return 0;
 }
 
-int RGWRados::init_bucket_index(rgw_bucket& bucket)
+int RGWRados::init_bucket_index(rgw_bucket& bucket, int num_shards)
 {
   librados::IoCtx index_ctx; // context for new bucket
 
@@ -2387,7 +2387,7 @@ int RGWRados::init_bucket_index(rgw_bucket& bucket)
   dir_oid.append(bucket.marker);
 
   map<int, string> bucket_objs;
-  get_bucket_index_objects(dir_oid, bucket_index_max_shards, bucket_objs);
+  get_bucket_index_objects(dir_oid, num_shards, bucket_objs);
 
   return CLSRGWIssueBucketIndexInit(index_ctx, bucket_objs, cct->_conf->rgw_bucket_index_max_aio)();
 }
@@ -2440,7 +2440,7 @@ int RGWRados::create_bucket(RGWUserInfo& owner, rgw_bucket& bucket,
     string dir_oid =  dir_oid_prefix;
     dir_oid.append(bucket.marker);
 
-    r = init_bucket_index(bucket);
+    r = init_bucket_index(bucket, bucket_index_max_shards);
     if (r < 0)
       return r;
 
index 5c5a6bf3f3b1d626f4431e154234b68c3e8f9cac..ef387dabc8cf020fda5c5ae1947c897592e628c7 100644 (file)
@@ -1489,7 +1489,7 @@ public:
    * create a bucket with name bucket and the given list of attrs
    * returns 0 on success, -ERR# otherwise.
    */
-  virtual int init_bucket_index(rgw_bucket& bucket);
+  virtual int init_bucket_index(rgw_bucket& bucket, int num_shards);
   int select_bucket_placement(RGWUserInfo& user_info, const string& region_name, const std::string& rule,
                               const std::string& bucket_name, rgw_bucket& bucket, string *pselected_rule);
   int select_legacy_bucket_placement(const string& bucket_name, rgw_bucket& bucket);