From 0bf78de1d54adfed5694d98381679000bb07f25a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 25 Oct 2021 16:08:31 -0400 Subject: [PATCH] osd: add 'rotate-stored-key' asok command This writes the key to the osd_key in the block device label. Signed-off-by: Sage Weil --- src/osd/OSD.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 8b9aa4feb12b1..acbfdf4667c22 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -2794,6 +2794,8 @@ will start to track new ops received afterwards."; store->generate_db_histogram(f); } else if (prefix == "flush_store_cache") { store->flush_cache(&ss); + } else if (prefix == "rotate-stored-key") { + store->write_meta("osd_key", inbl.to_str()); } else if (prefix == "dump_pgstate_history") { f->open_object_section("pgstate_history"); f->open_array_section("pgs"); @@ -3987,6 +3989,10 @@ void OSD::final_init() asok_hook, "Flush bluestore internal cache"); ceph_assert(r == 0); + r = admin_socket->register_command("rotate-stored-key", + asok_hook, + "Update the stored osd_key"); + ceph_assert(r == 0); r = admin_socket->register_command("dump_pgstate_history", asok_hook, "show recent state history"); -- 2.39.5