}
}
+static int check_pool_support_omap(rgw_pool pool)
+{
+ librados::IoCtx io_ctx;
+ int ret = store->get_rados_handle()->ioctx_create(pool.to_str().c_str(), io_ctx);
+ if (ret < 0) {
+ // the pool may not exist at this moment, we have no way to check if it supports omap.
+ return 0;
+ }
+
+ ret = io_ctx.omap_clear("__omap_test_not_exist_oid__");
+ if (ret == -EOPNOTSUPP) {
+ io_ctx.close();
+ return ret;
+ }
+ io_ctx.close();
+ return 0;
+}
+
int check_reshard_bucket_params(RGWRados *store,
const string& bucket_name,
const string& tenant,
if (compression_type) {
info.compression_type = *compression_type;
}
+
+ ret = check_pool_support_omap(info.get_data_extra_pool());
+ if (ret < 0) {
+ cerr << "ERROR: the data extra (non-ec) pool '" << info.get_data_extra_pool()
+ << "' does not support omap" << std::endl;
+ return ret;
+ }
} else if (opt_cmd == OPT_ZONE_PLACEMENT_MODIFY) {
auto p = zone.placement_pools.find(placement_id);
if (p == zone.placement_pools.end()) {
if (compression_type) {
info.compression_type = *compression_type;
}
+
+ ret = check_pool_support_omap(info.get_data_extra_pool());
+ if (ret < 0) {
+ cerr << "ERROR: the data extra (non-ec) pool '" << info.get_data_extra_pool()
+ << "' does not support omap" << std::endl;
+ return ret;
+ }
} else if (opt_cmd == OPT_ZONE_PLACEMENT_RM) {
zone.placement_pools.erase(placement_id);
}