]> 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)
committerRobin H. Johnson <robin.johnson@dreamhost.com>
Thu, 9 Feb 2017 22:36:21 +0000 (14:36 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(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 <robin.johnson@dreamhost.com>
src/rgw/rgw_admin.cc

index 9241cba6088b6c1b2039d8df7086bf5e0e551d0a..3996bfd6e160be0188f617ab14293c9c3ae98704 100644 (file)
@@ -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<string, bufferlist> attrs;
     int ret = init_bucket(tenant, bucket_name, bucket_id, bucket_info, bucket, &attrs);