From 17d6a993fc17d533460c5f40f3908c708e057c18 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 23 May 2024 18:45:17 +0200 Subject: Merging upstream version 18.2.3. Signed-off-by: Daniel Baumann --- src/rgw/rgw_admin.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/rgw/rgw_admin.cc') diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 73b0736b1..5cabd2a9b 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -3025,6 +3025,14 @@ int check_reshard_bucket_params(rgw::sal::Driver* driver, return ret; } + if (! is_layout_reshardable((*bucket)->get_info().layout)) { + std::cerr << "Bucket '" << (*bucket)->get_name() << + "' currently has layout '" << + current_layout_desc((*bucket)->get_info().layout) << + "', which does not support resharding." << std::endl; + return -EINVAL; + } + int num_source_shards = rgw::current_num_shards((*bucket)->get_info().layout); if (num_shards <= num_source_shards && !yes_i_really_mean_it) { @@ -8107,7 +8115,8 @@ next: "have the resharding feature enabled." << std::endl; return ENOTSUP; } - if (!RGWBucketReshard::can_reshard(bucket->get_info(), zone_svc) && + + if (!RGWBucketReshard::should_zone_reshard_now(bucket->get_info(), zone_svc) && !yes_i_really_mean_it) { std::cerr << "Bucket '" << bucket->get_name() << "' already has too many " "log generations (" << bucket->get_info().layout.logs.size() << ") " -- cgit v1.2.3