From: Yehuda Sadeh Date: Sat, 24 Sep 2016 17:01:00 +0000 (-0700) Subject: radosgw-admin: bucket reshard needs --num-shards to be specified X-Git-Tag: v10.2.6~22^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b40ce2738964c6fc1c9c390af18758b16820cdb9;p=ceph.git radosgw-admin: bucket reshard needs --num-shards to be specified Signed-off-by: Yehuda Sadeh (cherry picked from commit d0569f913340cb251c1a49f1e470b176d8b34346) See: http://tracker.ceph.com/issues/17556 See: https://github.com/ceph/ceph/pull/11368 Signed-off-by: Robin H. Johnson --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 9241cba6088b..3996bfd6e160 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -2164,6 +2164,7 @@ int main(int argc, char **argv) string job_id; int num_shards = 0; + bool num_shards_specified = false; int max_concurrent_ios = 32; uint64_t orphan_stale_secs = (24 * 3600); @@ -2298,6 +2299,7 @@ int main(int argc, char **argv) cerr << "ERROR: failed to parse num shards: " << err << std::endl; return EINVAL; } + num_shards_specified = true; } else if (ceph_argparse_witharg(args, i, &val, "--max-concurrent-ios", (char*)NULL)) { max_concurrent_ios = (int)strict_strtol(val.c_str(), 10, &err); if (!err.empty()) { @@ -4907,6 +4909,11 @@ next: return EINVAL; } + if (!num_shards_specified) { + cerr << "ERROR: --num-shards not specified" << std::endl; + return EINVAL; + } + RGWBucketInfo bucket_info; map attrs; int ret = init_bucket(tenant, bucket_name, bucket_id, bucket_info, bucket, &attrs);