From 7421643f9320fe5d299fe3fcd8afcf955a712819 Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Thu, 14 Feb 2019 17:40:44 +0100 Subject: [PATCH] rgw-admin: add a detailed mode Signed-off-by: Abhishek Lekshmanan (cherry picked from commit 143ff0d835c99b06e57a373bed2c61e84293ccc7) Conflicts: src/rgw/rgw_admin.cc Trivial merge conflct due to OTP changeset in Mimic --- src/rgw/rgw_admin.cc | 6 +++++- src/test/cli/radosgw-admin/help.t | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 1fcdba04c65..2209169c0f4 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -327,6 +327,7 @@ void usage() cout << " --orphan-stale-secs num of seconds to wait before declaring an object to be an orphan (default: 86400)\n"; cout << " --job-id set the job id (for orphans find)\n"; cout << " --max-concurrent-ios maximum concurrent ios for orphans find (default: 32)\n"; + cout << " --detail detailed mode, log and stat head objects as well\n"; cout << "\nOrphans list-jobs options:\n"; cout << " --extra-info provide extra info in job list\n"; cout << "\nRole options:\n"; @@ -2689,6 +2690,7 @@ int main(int argc, const char **argv) bool num_shards_specified = false; int max_concurrent_ios = 32; uint64_t orphan_stale_secs = (24 * 3600); + int detail = false; std::string val; std::ostringstream errs; @@ -3045,6 +3047,8 @@ int main(int argc, const char **argv) path_prefix = val; } else if (ceph_argparse_witharg(args, i, &val, "--trim-delay-ms", (char*)NULL)) { trim_delay_ms = atoi(val.c_str()); + } else if (ceph_argparse_binary_flag(args, i, &detail, NULL, "--detail", (char*)NULL)) { + // do nothing } else if (strncmp(*i, "-", 1) == 0) { cerr << "ERROR: invalid flag " << *i << std::endl; return EINVAL; @@ -6312,7 +6316,7 @@ next: info.job_name = job_id; info.num_shards = num_shards; - int ret = search.init(job_id, &info); + int ret = search.init(job_id, &info, detail); if (ret < 0) { cerr << "could not init search, ret=" << ret << std::endl; return -ret; diff --git a/src/test/cli/radosgw-admin/help.t b/src/test/cli/radosgw-admin/help.t index 706a5673932..b2b60e9cb2b 100644 --- a/src/test/cli/radosgw-admin/help.t +++ b/src/test/cli/radosgw-admin/help.t @@ -268,6 +268,7 @@ --orphan-stale-secs num of seconds to wait before declaring an object to be an orphan (default: 86400) --job-id set the job id (for orphans find) --max-concurrent-ios maximum concurrent ios for orphans find (default: 32) + --detail detailed mode, log and stat head objects as well Orphans list-jobs options: --extra-info provide extra info in job list -- 2.47.3