]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw-admin: bucket reshard needs --num-shards to be specified
authorYehuda Sadeh <yehuda@redhat.com>
Sat, 24 Sep 2016 17:01:00 +0000 (10:01 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Wed, 19 Oct 2016 15:41:47 +0000 (08:41 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_admin.cc

index bff59be3c320103eff52fe6de3beb9e366ab1ba0..5f46f6e1b3b945f9b306ba8351a14f144f42e013 100644 (file)
@@ -2165,6 +2165,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);
 
@@ -2302,6 +2303,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()) {
@@ -4736,6 +4738,11 @@ next:
       return EINVAL;
     }
 
+    if (!num_shards_specified) {
+      cerr << "ERROR: --num-shards not specified" << std::endl;
+      return EINVAL;
+    }
+
     RGWBucketInfo bucket_info;
     map<string, bufferlist> attrs;
     int ret = init_bucket(tenant, bucket_name, bucket_id, bucket_info, bucket, &attrs);