Skip to content

Commit

Permalink
Merge pull request ceph#12076 from cbodley/wip-rgw-region-root
Browse files Browse the repository at this point in the history
rgw: region conversion respects pre-existing rgw_region_root_pool
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
Signed-off-by: Jing Wenjun <jingwenjun@cmss.chinamobile.com>
  • Loading branch information
oritwas authored and Jing-Scott committed Nov 20, 2016
2 parents 64bcf92 + b81d880 commit 4c98012
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/common/config_opts.h
Expand Up @@ -1445,6 +1445,7 @@ OPTION(rgw_zone, OPT_STR, "") // zone name
OPTION(rgw_zone_root_pool, OPT_STR, ".rgw.root") // pool where zone specific info is stored
OPTION(rgw_default_zone_info_oid, OPT_STR, "default.zone") // oid where default zone info is stored
OPTION(rgw_region, OPT_STR, "") // region name
OPTION(rgw_region_root_pool, OPT_STR, ".rgw.root") // pool where all region info is stored
OPTION(rgw_default_region_info_oid, OPT_STR, "default.region") // oid where default region info is stored
OPTION(rgw_zonegroup, OPT_STR, "") // zone group name
OPTION(rgw_zonegroup_root_pool, OPT_STR, ".rgw.root") // pool where all zone group info is stored
Expand Down
1 change: 1 addition & 0 deletions src/rgw/rgw_bucket.cc
Expand Up @@ -119,6 +119,7 @@ int rgw_read_user_buckets(RGWRados * store,
string m = marker;

uint64_t total = 0;
//adfadsf

if (!max) {
max = default_amount;
Expand Down
14 changes: 14 additions & 0 deletions src/rgw/rgw_main.cc
Expand Up @@ -271,6 +271,20 @@ int main(int argc, const char **argv)
}
}

// maintain existing region root pool for new multisite objects
if (!g_conf->rgw_region_root_pool.empty()) {
const char *root_pool = g_conf->rgw_region_root_pool.c_str();
if (g_conf->rgw_zonegroup_root_pool.empty()) {
g_conf->set_val_or_die("rgw_zonegroup_root_pool", root_pool);
}
if (g_conf->rgw_period_root_pool.empty()) {
g_conf->set_val_or_die("rgw_period_root_pool", root_pool);
}
if (g_conf->rgw_realm_root_pool.empty()) {
g_conf->set_val_or_die("rgw_realm_root_pool", root_pool);
}
}

check_curl();

if (g_conf->daemonize) {
Expand Down
4 changes: 2 additions & 2 deletions src/rgw/rgw_rados.cc
Expand Up @@ -3334,9 +3334,9 @@ int RGWRados::convert_regionmap()
{
RGWZoneGroupMap zonegroupmap;

string pool_name = cct->_conf->rgw_zone_root_pool;
string pool_name = cct->_conf->rgw_region_root_pool;
if (pool_name.empty()) {
pool_name = RGW_DEFAULT_ZONE_ROOT_POOL;
pool_name = RGW_DEFAULT_ZONEGROUP_ROOT_POOL;
}
string oid = region_map_oid;

Expand Down

0 comments on commit 4c98012

Please sign in to comment.