From 75483d408633a93653dc3401e45573d2d8847cf3 Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Fri, 20 Mar 2020 11:20:10 -0400 Subject: [PATCH] rgw: deprecate radosgw-admin orphans sub-commands The orphans sub-commands have not been maintained for years and it's unclear whether they're reliable. Additionally, they store logs on the cluster, so if a user wants to run it to address a nearly full cluster, it could push the user over the edge. As a result the (currently experimental) `rgw-orphan-list` tool (separate executable rather than a sub-command) has been created, which stores intermediate results on the local filesystem. Now all three orphans sub-commands produce a warning (on cerr) that the command is being deprecated. Additionally all three now require the --yes-i-really-mean-it command-line option to run. This also documents the "bucket radoslist" sub-command to `radosgw-admin` in its corresponding man page, a change that was omitted from the prior commit that added "bucket radoslist" documentation. Signed-off-by: J. Eric Ivancich --- doc/man/8/radosgw-admin.rst | 12 +++++++++-- src/rgw/rgw_admin.cc | 34 +++++++++++++++++++++++++++---- src/test/cli/radosgw-admin/help.t | 7 ++++--- 3 files changed, 44 insertions(+), 9 deletions(-) diff --git a/doc/man/8/radosgw-admin.rst b/doc/man/8/radosgw-admin.rst index 27569fa53e2..a80f95d2d43 100644 --- a/doc/man/8/radosgw-admin.rst +++ b/doc/man/8/radosgw-admin.rst @@ -108,6 +108,11 @@ which are as follows: :command:`bucket rewrite` Rewrite all objects in the specified bucket. +:command:`bucket radoslist` + List the rados objects that contain the data for all objects is + the designated bucket, if --bucket= is specified, or + otherwise all buckets. + :command:`bucket reshard` Reshard a bucket. @@ -399,13 +404,16 @@ which are as follows: Read data log status. :command:`orphans find` - Init and run search for leaked rados objects + Init and run search for leaked rados objects. + DEPRECATED. See the "rgw-orphan-list" tool. :command:`orphans finish` - Clean up search for leaked rados objects + Clean up search for leaked rados objects. + DEPRECATED. See the "rgw-orphan-list" tool. :command:`orphans list-jobs` List the current job-ids for the orphans search. + DEPRECATED. See the "rgw-orphan-list" tool. :command:`role create` create a new AWS role for use with STS. diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 99285b44443..c44f7dc1c9b 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -242,9 +242,10 @@ void usage() cout << " datalog list list data log\n"; cout << " datalog trim trim data log\n"; cout << " datalog status read data log status\n"; - cout << " orphans find init and run search for leaked rados objects (use job-id, pool)\n"; - cout << " orphans finish clean up search for leaked rados objects\n"; - cout << " orphans list-jobs list the current job-ids for orphans search\n"; + cout << " orphans find deprecated -- init and run search for leaked rados objects (use job-id, pool)\n"; + cout << " orphans finish deprecated -- clean up search for leaked rados objects\n"; + cout << " orphans list-jobs deprecated -- list the current job-ids for orphans search\n"; + cout << " * the three 'orphans' sub-commands are now deprecated; consider using the `rgw-orphan-list` tool\n"; cout << " role create create a AWS role for use with STS\n"; cout << " role rm remove a role\n"; cout << " role get get a role\n"; @@ -7264,10 +7265,14 @@ next: if (opt_cmd == OPT::ORPHANS_FIND) { if (!yes_i_really_mean_it) { - cerr << "accidental removal of active objects can not be reversed; " + cerr << "this command is now deprecated; please consider using the rgw-orphan-list tool; " + << "accidental removal of active objects cannot be reversed; " << "do you really mean it? (requires --yes-i-really-mean-it)" << std::endl; return EINVAL; + } else { + cerr << "IMPORTANT: this command is now deprecated; please consider using the rgw-orphan-list tool" + << std::endl; } RGWOrphanSearch search(store, max_concurrent_ios, orphan_stale_secs); @@ -7299,6 +7304,17 @@ next: } if (opt_cmd == OPT::ORPHANS_FINISH) { + if (!yes_i_really_mean_it) { + cerr << "this command is now deprecated; please consider using the rgw-orphan-list tool; " + << "accidental removal of active objects cannot be reversed; " + << "do you really mean it? (requires --yes-i-really-mean-it)" + << std::endl; + return EINVAL; + } else { + cerr << "IMPORTANT: this command is now deprecated; please consider using the rgw-orphan-list tool" + << std::endl; + } + RGWOrphanSearch search(store, max_concurrent_ios, orphan_stale_secs); if (job_id.empty()) { @@ -7319,6 +7335,16 @@ next: } if (opt_cmd == OPT::ORPHANS_LIST_JOBS){ + if (!yes_i_really_mean_it) { + cerr << "this command is now deprecated; please consider using the rgw-orphan-list tool; " + << "do you really mean it? (requires --yes-i-really-mean-it)" + << std::endl; + return EINVAL; + } else { + cerr << "IMPORTANT: this command is now deprecated; please consider using the rgw-orphan-list tool" + << std::endl; + } + RGWOrphanStore orphan_store(store); int ret = orphan_store.init(); if (ret < 0){ diff --git a/src/test/cli/radosgw-admin/help.t b/src/test/cli/radosgw-admin/help.t index 4f2e1bfc85e..93bdcc06ca8 100644 --- a/src/test/cli/radosgw-admin/help.t +++ b/src/test/cli/radosgw-admin/help.t @@ -137,9 +137,10 @@ datalog list list data log datalog trim trim data log datalog status read data log status - orphans find init and run search for leaked rados objects (use job-id, pool) - orphans finish clean up search for leaked rados objects - orphans list-jobs list the current job-ids for orphans search + orphans find deprecated -- init and run search for leaked rados objects (use job-id, pool) + orphans finish deprecated -- clean up search for leaked rados objects + orphans list-jobs deprecated -- list the current job-ids for orphans search + * the three 'orphans' sub-commands are now deprecated; consider using the `rgw-orphan-list` tool role create create a AWS role for use with STS role rm remove a role role get get a role