radosgw-admin should prevent a bucket from being added to the reshard
list if it is currently being resharded.
Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
#include "include/util.h"
+#include "cls/rgw/cls_rgw_types.h"
#include "cls/rgw/cls_rgw_client.h"
#include "global/global_init.h"
return ret;
}
+ if (bucket_info.reshard_status != CLS_RGW_RESHARD_NOT_RESHARDING) {
+ // if in_progress or done then we have an old BucketInfo
+ cerr << "ERROR: the bucket is currently undergoing resharding and "
+ "cannot be added to the reshard list at this time" << std::endl;
+ return -EBUSY;
+ }
+
int num_source_shards = (bucket_info.num_shards > 0 ? bucket_info.num_shards : 1);
if (num_shards <= num_source_shards && !yes_i_really_mean_it) {