]> 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>
Fri, 30 Sep 2016 17:16:36 +0000 (10:16 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Conflicts:
src/rgw/rgw_admin.cc

src/rgw/rgw_admin.cc

index 4eed8ed2b0230394a60f9fe88d55b825734761a7..a4483ad8db619f54d5b1015c26df177f9eb839f4 100644 (file)
@@ -1214,6 +1214,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);
 
@@ -1322,6 +1323,7 @@ int main(int argc, char **argv)
       end_date = val;
     } else if (ceph_argparse_witharg(args, i, &val, "--num-shards", (char*)NULL)) {
       num_shards = atoi(val.c_str());
+      num_shards_specified = true;
     } else if (ceph_argparse_witharg(args, i, &val, "--max-concurrent-ios", (char*)NULL)) {
       max_concurrent_ios = atoi(val.c_str());
     } else if (ceph_argparse_witharg(args, i, &val, "--orphan-stale-secs", (char*)NULL)) {
@@ -2545,6 +2547,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(bucket_name, bucket_id, bucket_info, bucket, &attrs);