]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
neorados: allow a client to wait for the latest OSD map
authorJason Dillaman <dillaman@redhat.com>
Tue, 14 Jul 2020 22:39:31 +0000 (18:39 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 16 Jul 2020 19:59:31 +0000 (15:59 -0400)
This is required when issuing a client blacklist to ensure that
they cannot overwrite any OSD data before their map updates.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/include/neorados/RADOS.hpp
src/neorados/RADOS.cc

index 98bed7625add80cc9c3ea59f7d6037a9f4e1063f..45932e1635462a64ec593fc6079640f860b124f7 100644 (file)
@@ -941,6 +941,15 @@ public:
                                            std::move(init.completion_handler)));
     return init.result.get();
   }
+
+  template<typename CompletionToken>
+  auto wait_for_latest_osd_map(CompletionToken&& token) {
+    boost::asio::async_completion<CompletionToken, SimpleOpSig> init(token);
+    wait_for_latest_osd_map(
+      SimpleOpComp::create(get_executor(), std::move(init.completion_handler)));
+    return init.result.get();
+  }
+
   uint64_t instance_id() const;
 
 private:
@@ -1073,6 +1082,7 @@ private:
   void enable_application(std::string_view pool, std::string_view app_name,
                          bool force, std::unique_ptr<SimpleOpComp> c);
 
+  void wait_for_latest_osd_map(std::unique_ptr<SimpleOpComp> c);
 
   // Proxy object to provide access to low-level RADOS messaging clients
   std::unique_ptr<detail::Client> impl;
index d01c67ae8bd54bc8ad2d059e0f4e978490a0cbde..54e2a23e1a859159a21d226e6b976d66f2ec8f36 100644 (file)
@@ -1558,6 +1558,10 @@ void RADOS::enable_application(std::string_view pool, std::string_view app_name,
   }
 }
 
+void RADOS::wait_for_latest_osd_map(std::unique_ptr<SimpleOpComp> c) {
+  impl->objecter->wait_for_latest_osdmap(std::move(c));
+}
+
 void RADOS::mon_command(std::vector<std::string> command,
                        const cb::list& bl,
                        std::string* outs, cb::list* outbl,