From: Adam Emerson Date: Fri, 8 Sep 2023 20:50:46 +0000 (-0400) Subject: neorados: Notify fixes X-Git-Tag: v19.3.0~349^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1d6b9c8052db95311ccff9b6c0cebbefc1bcd114;p=ceph.git neorados: Notify fixes 1. Objecter expects a count of seconds, not milliseconds 2. Actually return result Signed-off-by: Adam Emerson --- diff --git a/src/include/neorados/RADOS.hpp b/src/include/neorados/RADOS.hpp index dbc4aff3c5a..a9c9cf1462d 100644 --- a/src/include/neorados/RADOS.hpp +++ b/src/include/neorados/RADOS.hpp @@ -1670,7 +1670,7 @@ public: using NotifyComp = boost::asio::any_completion_handler; template CompletionToken> auto notify(Object o, IOContext ioc, ceph::buffer::list bl, - std::optional timeout, + std::optional timeout, CompletionToken&& token) { auto consigned = boost::asio::consign( std::forward(token), boost::asio::make_work_guard( @@ -1844,7 +1844,7 @@ private: SimpleOpComp); void notify_(Object oid, IOContext ioctx, ceph::buffer::list bl, - std::optional timeout, + std::optional timeout, NotifyComp c); void flush_watch_(VoidOpComp); diff --git a/src/neorados/RADOS.cc b/src/neorados/RADOS.cc index 9b743f6e986..3d97ead1ff7 100644 --- a/src/neorados/RADOS.cc +++ b/src/neorados/RADOS.cc @@ -1451,8 +1451,9 @@ struct NotifyHandler : std::enable_shared_from_this { bufferlist&& bl) { asio::post( strand, - [this, ec, p = shared_from_this()]() mutable { + [this, ec, bl = std::move(bl), p = shared_from_this()]() mutable { finished = true; + rbl = std::move(bl); maybe_cleanup(ec); }); } @@ -1470,7 +1471,7 @@ struct NotifyHandler : std::enable_shared_from_this { }; void RADOS::notify_(Object o, IOContext _ioc, bufferlist bl, - std::optional timeout, + std::optional timeout, NotifyComp c) { auto oid = reinterpret_cast(&o.impl); @@ -1490,9 +1491,11 @@ void RADOS::notify_(Object o, IOContext _ioc, bufferlist bl, }); ObjectOperation rd; bufferlist inbl; + // 30s is the default in librados. Use that rather than borrowing from CephFS. + // TODO add a config option later. rd.notify( linger_op->get_cookie(), 1, - timeout ? timeout->count() : impl->cct->_conf->client_notify_timeout, + timeout.value_or(30s).count(), bl, &inbl); impl->objecter->linger_notify(