]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add 'rotate-stored-key' asok command
authorSage Weil <sage@newdream.net>
Mon, 25 Oct 2021 20:08:31 +0000 (16:08 -0400)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 14 Sep 2022 16:15:57 +0000 (16:15 +0000)
This writes the key to the osd_key in the block device label.

Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 0bf78de1d54adfed5694d98381679000bb07f25a)

src/osd/OSD.cc

index fca6c742fff41b85d09eed4c5a9eced4a17bb073..4e5ab7f0adc7944caa658305ead8a10fa4651b26 100644 (file)
@@ -2787,6 +2787,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");
@@ -3975,6 +3977,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");