Skip to content

Commit

Permalink
Merge pull request #6163: rgw: region data still exist in region-map …
Browse files Browse the repository at this point in the history
…after region-map update

Reviewed-by: Loic Dachary <ldachary@redhat.com>
  • Loading branch information
ldachary committed Oct 8, 2015
2 parents 9144904 + ad83304 commit 87d043a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/rgw/rgw_admin.cc
Expand Up @@ -166,6 +166,7 @@ void _usage()
cerr << " --categories=<list> comma separated list of categories, used in usage show\n";
cerr << " --caps=<caps> list of caps (e.g., \"usage=read, write; user=read\"\n";
cerr << " --yes-i-really-mean-it required for certain operations\n";
cerr << " --reset-regions reset regionmap when regionmap update";
cerr << "\n";
cerr << "<date> := \"YYYY-MM-DD[ hh:mm:ss]\"\n";
cerr << "\nQuota options:\n";
Expand Down Expand Up @@ -1144,6 +1145,7 @@ int main(int argc, char **argv)
int include_all = false;

int sync_stats = false;
int reset_regions = false;

uint64_t min_rewrite_size = 4 * 1024 * 1024;
uint64_t max_rewrite_size = ULLONG_MAX;
Expand Down Expand Up @@ -1316,6 +1318,8 @@ int main(int argc, char **argv)
// do nothing
} else if (ceph_argparse_binary_flag(args, i, &include_all, NULL, "--include-all", (char*)NULL)) {
// do nothing
} else if (ceph_argparse_binary_flag(args, i, &reset_regions, NULL, "--reset-regions", (char*)NULL)) {
// do nothing
} else if (ceph_argparse_witharg(args, i, &val, "--caps", (char*)NULL)) {
caps = val;
} else if (ceph_argparse_witharg(args, i, &val, "-i", "--infile", (char*)NULL)) {
Expand Down Expand Up @@ -1554,6 +1558,10 @@ int main(int argc, char **argv)
return -ret;
}

if (reset_regions) {
regionmap.regions.clear();
}

for (list<string>::iterator iter = regions.begin(); iter != regions.end(); ++iter) {
ret = region.read_info(*iter);
if (ret < 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/cli/radosgw-admin/help.t
Expand Up @@ -123,7 +123,7 @@
--categories=<list> comma separated list of categories, used in usage show
--caps=<caps> list of caps (e.g., "usage=read, write; user=read"
--yes-i-really-mean-it required for certain operations
--reset-regions reset regionmap when regionmap update
<date> := "YYYY-MM-DD[ hh:mm:ss]"
Quota options:
Expand Down

0 comments on commit 87d043a

Please sign in to comment.