From b6a5c09dba54c4e20a8c1423abf5a39350a5734e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 4 Oct 2017 21:31:12 -0500 Subject: [PATCH] ceph-objectstore-tool: remove rm-past-intervals op The OSD doesn't rebuild this on demand anymore. Signed-off-by: Sage Weil --- .../special/ceph_objectstore_tool.py | 2 +- qa/tasks/ceph_manager.py | 49 ------------------- src/tools/ceph_objectstore_tool.cc | 35 ++----------- 3 files changed, 6 insertions(+), 80 deletions(-) diff --git a/qa/standalone/special/ceph_objectstore_tool.py b/qa/standalone/special/ceph_objectstore_tool.py index 630fd10f1ae..cb82d7dbebd 100755 --- a/qa/standalone/special/ceph_objectstore_tool.py +++ b/qa/standalone/special/ceph_objectstore_tool.py @@ -1030,7 +1030,7 @@ def main(argv): # Specify a bad --op command cmd = (CFSD_PREFIX + "--op oops").format(osd=ONEOSD) - ERRORS += test_failure(cmd, "Must provide --op (info, log, remove, mkfs, fsck, repair, export, export-remove, import, list, fix-lost, list-pgs, rm-past-intervals, dump-journal, dump-super, meta-list, get-osdmap, set-osdmap, get-inc-osdmap, set-inc-osdmap, mark-complete)") + ERRORS += test_failure(cmd, "Must provide --op (info, log, remove, mkfs, fsck, repair, export, export-remove, import, list, fix-lost, list-pgs, dump-journal, dump-super, meta-list, get-osdmap, set-osdmap, get-inc-osdmap, set-inc-osdmap, mark-complete)") # Provide just the object param not a command cmd = (CFSD_PREFIX + "object").format(osd=ONEOSD) diff --git a/qa/tasks/ceph_manager.py b/qa/tasks/ceph_manager.py index 3cc74711e57..ab86930d848 100644 --- a/qa/tasks/ceph_manager.py +++ b/qa/tasks/ceph_manager.py @@ -160,7 +160,6 @@ class Thrasher: not self.cmd_exists_on_osds("ceph-objectstore-tool") or self.config.get('disable_objectstore_tool_tests', False)): self.ceph_objectstore_tool = False - self.test_rm_past_intervals = False if self.config.get('powercycle'): self.log("Unable to test ceph-objectstore-tool, " "powercycle testing") @@ -170,8 +169,6 @@ class Thrasher: else: self.ceph_objectstore_tool = \ self.config.get('ceph_objectstore_tool', True) - self.test_rm_past_intervals = \ - self.config.get('test_rm_past_intervals', True) # spawn do_thrash self.thread = gevent.spawn(self.do_thrash) if self.sighup_delay: @@ -366,50 +363,6 @@ class Thrasher: raise Exception("ceph-objectstore-tool apply-layout-settings" " failed with {status}".format(status=proc.exitstatus)) - def rm_past_intervals(self, osd=None): - """ - :param osd: Osd to find pg to remove past intervals - """ - if self.test_rm_past_intervals: - if osd is None: - osd = random.choice(self.dead_osds) - self.log("Use ceph_objectstore_tool to remove past intervals") - remote = self.ceph_manager.find_remote('osd', osd) - FSPATH = self.ceph_manager.get_filepath() - JPATH = os.path.join(FSPATH, "journal") - if ('keyvaluestore_backend' in - self.ceph_manager.ctx.ceph[self.cluster].conf['osd']): - prefix = ("sudo adjust-ulimits ceph-objectstore-tool " - "--data-path {fpath} --journal-path {jpath} " - "--type keyvaluestore " - "--log-file=" - "/var/log/ceph/objectstore_tool.\\$pid.log ". - format(fpath=FSPATH, jpath=JPATH)) - else: - prefix = ("sudo adjust-ulimits ceph-objectstore-tool " - "--data-path {fpath} --journal-path {jpath} " - "--log-file=" - "/var/log/ceph/objectstore_tool.\\$pid.log ". - format(fpath=FSPATH, jpath=JPATH)) - cmd = (prefix + "--op list-pgs").format(id=osd) - proc = remote.run(args=cmd, wait=True, - check_status=False, stdout=StringIO()) - if proc.exitstatus: - raise Exception("ceph_objectstore_tool: " - "exp list-pgs failure with status {ret}". - format(ret=proc.exitstatus)) - pgs = proc.stdout.getvalue().split('\n')[:-1] - if len(pgs) == 0: - self.log("No PGs found for osd.{osd}".format(osd=osd)) - return - pg = random.choice(pgs) - cmd = (prefix + "--op rm-past-intervals --pgid {pg}").\ - format(id=osd, pg=pg) - proc = remote.run(args=cmd) - if proc.exitstatus: - raise Exception("ceph_objectstore_tool: " - "rm-past-intervals failure with status {ret}". - format(ret=proc.exitstatus)) def blackhole_kill_osd(self, osd=None): """ @@ -852,8 +805,6 @@ class Thrasher: actions.append((self.out_osd, 1.0,)) if len(self.live_osds) > minlive and chance_down > 0: actions.append((self.kill_osd, chance_down,)) - if len(self.dead_osds) > 1: - actions.append((self.rm_past_intervals, 1.0,)) if len(self.out_osds) > minout: actions.append((self.in_osd, 1.7,)) if len(self.dead_osds) > mindead: diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index 26e2a89135e..b6d23c5e06a 100644 --- a/src/tools/ceph_objectstore_tool.cc +++ b/src/tools/ceph_objectstore_tool.cc @@ -2500,11 +2500,11 @@ int main(int argc, char **argv) ("journal-path", po::value(&jpath), "path to journal, use if tool can't find it") ("pgid", po::value(&pgidstr), - "PG id, mandatory for info, log, remove, export, export-remove, rm-past-intervals, mark-complete, and mandatory for apply-layout-settings if --pool is not specified") + "PG id, mandatory for info, log, remove, export, export-remove, mark-complete, and mandatory for apply-layout-settings if --pool is not specified") ("pool", po::value(&pool), "Pool name, mandatory for apply-layout-settings if --pgid is not specified") ("op", po::value(&op), - "Arg is one of [info, log, remove, mkfs, fsck, repair, fuse, dup, export, export-remove, import, list, fix-lost, list-pgs, rm-past-intervals, dump-journal, dump-super, meta-list, " + "Arg is one of [info, log, remove, mkfs, fsck, repair, fuse, dup, export, export-remove, import, list, fix-lost, list-pgs, dump-journal, dump-super, meta-list, " "get-osdmap, set-osdmap, get-inc-osdmap, set-inc-osdmap, mark-complete, apply-layout-settings, update-mon-db]") ("epoch", po::value(&epoch), "epoch# for get-osdmap and get-inc-osdmap, the current epoch in use if not specified") @@ -3003,7 +3003,7 @@ int main(int argc, char **argv) // The ops which require --pgid option are checked here and // mentioned in the usage for --pgid. if ((op == "info" || op == "log" || op == "remove" || op == "export" - || op == "export-remove" || op == "rm-past-intervals" || op == "mark-complete") && + || op == "export-remove" || op == "mark-complete") && pgidstr.length() == 0) { cerr << "Must provide pgid" << std::endl; usage(desc); @@ -3206,8 +3206,8 @@ int main(int argc, char **argv) // If not an object command nor any of the ops handled below, then output this usage // before complaining about a bad pgid - if (!vm.count("objcmd") && op != "export" && op != "export-remove" && op != "info" && op != "log" && op != "rm-past-intervals" && op != "mark-complete") { - cerr << "Must provide --op (info, log, remove, mkfs, fsck, repair, export, export-remove, import, list, fix-lost, list-pgs, rm-past-intervals, dump-journal, dump-super, meta-list, " + if (!vm.count("objcmd") && op != "export" && op != "export-remove" && op != "info" && op != "log" && op != "mark-complete") { + cerr << "Must provide --op (info, log, remove, mkfs, fsck, repair, export, export-remove, import, list, fix-lost, list-pgs, dump-journal, dump-super, meta-list, " "get-osdmap, set-osdmap, get-inc-osdmap, set-inc-osdmap, mark-complete)" << std::endl; usage(desc); @@ -3504,31 +3504,6 @@ int main(int argc, char **argv) goto out; dump_log(formatter, cout, log, missing); - } else if (op == "rm-past-intervals") { - ObjectStore::Transaction tran; - ObjectStore::Transaction *t = &tran; - - if (struct_ver < PG::get_compat_struct_v()) { - cerr << "Can't remove past-intervals, version mismatch " << (int)struct_ver - << " (pg) < compat " << (int)PG::get_compat_struct_v() << " (tool)" - << std::endl; - ret = -EFAULT; - goto out; - } - - cout << "Remove past-intervals " << past_intervals << std::endl; - - past_intervals.clear(); - if (dry_run) { - ret = 0; - goto out; - } - ret = write_info(*t, map_epoch, info, past_intervals); - - if (ret == 0) { - fs->apply_transaction(osr, std::move(*t)); - cout << "Removal succeeded" << std::endl; - } } else if (op == "mark-complete") { ObjectStore::Transaction tran; ObjectStore::Transaction *t = &tran; -- 2.39.5