]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: when create_bucket use the same num_shards with info.num_shards 15450/head
authorlu.shasha <lu.shasha@eisoo.com>
Tue, 9 May 2017 07:05:03 +0000 (15:05 +0800)
committerNathan Cutler <ncutler@suse.com>
Wed, 12 Jul 2017 13:25:19 +0000 (15:25 +0200)
pr #14388 only fix the num_shards in BucketInfo, "init_bucket_index" function still use local num_shards

Fixes: http://tracker.ceph.com/issues/19745
Signed-off-by: Shasha Lu <lu.shasha@eisoo.com>
(cherry picked from commit 4ce64a190b4ff36985e785e574c077d39796feea)

Conflicts:
src/rgw/rgw_rados.cc: init_bucket_index() called earlier

src/rgw/rgw_rados.cc

index 4bde28b4826bdcef8ac84df176fff9976ca10890..1c76c8f9bf33291c33b6434cd334ba3e4f3139d7 100644 (file)
@@ -5205,8 +5205,13 @@ int RGWRados::create_bucket(RGWUserInfo& owner, rgw_bucket& bucket,
       bucket.marker = pmaster_bucket->marker;
       bucket.bucket_id = pmaster_bucket->bucket_id;
     }
+    if (pmaster_num_shards) {
+      info.num_shards = *pmaster_num_shards;
+    } else {
+      info.num_shards = bucket_index_max_shards;
+    }
 
-    r = init_bucket_index(bucket, bucket_index_max_shards);
+    r = init_bucket_index(bucket, info.num_shards);
     if (r < 0)
       return r;
 
@@ -5225,11 +5230,6 @@ int RGWRados::create_bucket(RGWUserInfo& owner, rgw_bucket& bucket,
     info.index_type = rule_info.index_type;
     info.swift_ver_location = swift_ver_location;
     info.swift_versioning = (!swift_ver_location.empty());
-    if (pmaster_num_shards) {
-      info.num_shards = *pmaster_num_shards;
-    } else {
-      info.num_shards = bucket_index_max_shards;
-    }
     info.bucket_index_shard_hash_type = RGWBucketInfo::MOD;
     info.requester_pays = false;
     if (real_clock::is_zero(creation_time))