Remove the zones from list of zones to sync from.
+.. option:: --bucket-index-max-shards
+
+ Override a zone's or zonegroup's default number of bucket index shards. This
+ option is accepted by the 'zone create', 'zone modify', 'zonegroup add',
+ and 'zonegroup modify' commands, and applies to buckets that are created
+ after the zone/zonegroup changes take effect.
+
.. option:: --fix
Besides checking bucket index, will also fix it.
cout << " set list of zones to sync from\n";
cout << " --sync-from-rm=[zone-name][,...]\n";
cout << " remove zones from list of zones to sync from\n";
+ cout << " --bucket-index-max-shards override a zone/zonegroup's default bucket index shard count\n";
cout << " --fix besides checking bucket index, will also fix it\n";
cout << " --check-objects bucket check: rebuilds bucket index according to\n";
cout << " actual objects state\n";
string job_id;
int num_shards = 0;
bool num_shards_specified = false;
+ std::optional<int> bucket_index_max_shards;
int max_concurrent_ios = 32;
uint64_t orphan_stale_secs = (24 * 3600);
int detail = false;
return EINVAL;
}
num_shards_specified = true;
+ } else if (ceph_argparse_witharg(args, i, &val, "--bucket-index-max-shards", (char*)NULL)) {
+ bucket_index_max_shards = (int)strict_strtol(val.c_str(), 10, &err);
+ if (!err.empty()) {
+ cerr << "ERROR: failed to parse bucket-index-max-shards: " << err << std::endl;
+ return EINVAL;
+ }
} 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()) {
(is_read_only_set ? &read_only : NULL),
endpoints, ptier_type,
psync_from_all, sync_from, sync_from_rm,
- predirect_zone,
+ predirect_zone, bucket_index_max_shards,
store->svc()->sync_modules->get_manager());
if (ret < 0) {
cerr << "failed to add zone " << zone_name << " to zonegroup " << zonegroup.get_name() << ": "
need_update = true;
}
+ if (bucket_index_max_shards) {
+ for (auto& [name, zone] : zonegroup.zones) {
+ zone.bucket_index_max_shards = *bucket_index_max_shards;
+ }
+ need_update = true;
+ }
+
if (need_update) {
ret = zonegroup.update();
if (ret < 0) {
ptier_type,
psync_from_all,
sync_from, sync_from_rm,
- predirect_zone,
+ predirect_zone, bucket_index_max_shards,
store->svc()->sync_modules->get_manager());
if (ret < 0) {
cerr << "failed to add zone " << zone_name << " to zonegroup " << zonegroup.get_name()
(is_read_only_set ? &read_only : NULL),
endpoints, ptier_type,
psync_from_all, sync_from, sync_from_rm,
- predirect_zone,
+ predirect_zone, bucket_index_max_shards,
store->svc()->sync_modules->get_manager());
if (ret < 0) {
cerr << "failed to update zonegroup: " << cpp_strerror(-ret) << std::endl;
int RGWZoneGroup::add_zone(const RGWZoneParams& zone_params, bool *is_master, bool *read_only,
const list<string>& endpoints, const string *ptier_type,
bool *psync_from_all, list<string>& sync_from, list<string>& sync_from_rm,
- string *predirect_zone, RGWSyncModulesManager *sync_mgr)
+ string *predirect_zone, std::optional<int> bucket_index_max_shards,
+ RGWSyncModulesManager *sync_mgr)
{
auto& zone_id = zone_params.get_id();
auto& zone_name = zone_params.get_name();
zone.redirect_zone = *predirect_zone;
}
+ if (bucket_index_max_shards) {
+ zone.bucket_index_max_shards = *bucket_index_max_shards;
+ }
+
for (auto add : sync_from) {
zone.sync_from.insert(add);
}
int equals(const std::string& other_zonegroup) const;
int add_zone(const RGWZoneParams& zone_params, bool *is_master, bool *read_only,
const list<std::string>& endpoints, const std::string *ptier_type,
- bool *psync_from_all, list<std::string>& sync_from, list<std::string>& sync_from_rm,
- std::string *predirect_zone, RGWSyncModulesManager *sync_mgr);
+ bool *psync_from_all, list<std::string>& sync_from,
+ list<std::string>& sync_from_rm, std::string *predirect_zone,
+ std::optional<int> bucket_index_max_shards, RGWSyncModulesManager *sync_mgr);
int remove_zone(const std::string& zone_id);
int rename_zone(const RGWZoneParams& zone_params);
rgw_pool get_pool(CephContext *cct) const override;
set list of zones to sync from
--sync-from-rm=[zone-name][,...]
remove zones from list of zones to sync from
+ --bucket-index-max-shards override a zone/zonegroup's default bucket index shard count
--fix besides checking bucket index, will also fix it
--check-objects bucket check: rebuilds bucket index according to
actual objects state