From: Jason Dillaman Date: Tue, 14 Jul 2020 22:39:31 +0000 (-0400) Subject: neorados: allow a client to wait for the latest OSD map X-Git-Tag: wip-pdonnell-testing-20200918.022351~622^2~18 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=24bd5fb2946053c2291619348183d0b12224fffa;p=ceph-ci.git neorados: allow a client to wait for the latest OSD map 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 --- diff --git a/src/include/neorados/RADOS.hpp b/src/include/neorados/RADOS.hpp index 98bed7625ad..45932e16354 100644 --- a/src/include/neorados/RADOS.hpp +++ b/src/include/neorados/RADOS.hpp @@ -941,6 +941,15 @@ public: std::move(init.completion_handler))); return init.result.get(); } + + template + auto wait_for_latest_osd_map(CompletionToken&& token) { + boost::asio::async_completion 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 c); + void wait_for_latest_osd_map(std::unique_ptr c); // Proxy object to provide access to low-level RADOS messaging clients std::unique_ptr impl; diff --git a/src/neorados/RADOS.cc b/src/neorados/RADOS.cc index d01c67ae8bd..54e2a23e1a8 100644 --- a/src/neorados/RADOS.cc +++ b/src/neorados/RADOS.cc @@ -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 c) { + impl->objecter->wait_for_latest_osdmap(std::move(c)); +} + void RADOS::mon_command(std::vector command, const cb::list& bl, std::string* outs, cb::list* outbl,