From: Samuel Just Date: Fri, 14 Jan 2022 04:58:16 +0000 (+0000) Subject: crimson: add and use FuturizedStore::flush() interface X-Git-Tag: v18.0.0~1562^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=14d4538477046067ae24104002a50049e61218ba;p=ceph.git crimson: add and use FuturizedStore::flush() interface Signed-off-by: Samuel Just --- diff --git a/src/crimson/os/futurized_store.h b/src/crimson/os/futurized_store.h index d25c09484508..c35cba9b05d8 100644 --- a/src/crimson/os/futurized_store.h +++ b/src/crimson/os/futurized_store.h @@ -10,6 +10,7 @@ #include +#include "os/Transaction.h" #include "crimson/osd/exceptions.h" #include "include/buffer_fwd.h" #include "include/uuid.h" @@ -134,6 +135,18 @@ public: virtual seastar::future<> do_transaction(CollectionRef ch, ceph::os::Transaction&& txn) = 0; + /** + * flush + * + * Flushes outstanding transactions on ch, returned future resolves + * after any previously submitted transactions on ch have committed. + * + * @param ch [in] collection on which to flush + */ + virtual seastar::future<> flush(CollectionRef ch) { + return do_transaction(ch, ceph::os::Transaction{}); + } + // error injection virtual seastar::future<> inject_data_error(const ghobject_t& o) { return seastar::now(); diff --git a/src/crimson/osd/pg.cc b/src/crimson/osd/pg.cc index aee8e8331657..f0b85b1f4bee 100644 --- a/src/crimson/osd/pg.cc +++ b/src/crimson/osd/pg.cc @@ -131,19 +131,19 @@ PG::~PG() {} bool PG::try_flush_or_schedule_async() { logger().debug("PG::try_flush_or_schedule_async: do_transaction..."); - (void)shard_services.get_store().do_transaction( - coll_ref, - ObjectStore::Transaction()).then( - [this, epoch=get_osdmap_epoch()]() { - return shard_services.start_operation( - this, - shard_services, - pg_whoami, - pgid, - epoch, - epoch, - PeeringState::IntervalFlush()); - }); + (void)shard_services.get_store().flush( + coll_ref + ).then( + [this, epoch=get_osdmap_epoch()]() { + return shard_services.start_operation( + this, + shard_services, + pg_whoami, + pgid, + epoch, + epoch, + PeeringState::IntervalFlush()); + }); return false; }