return do_submit(std::move(record), handle);
}
+seastar::future<> Journal::RecordSubmitter::flush(OrderingHandle &handle)
+{
+ return handle.enter(write_pipeline->device_submission
+ ).then([this, &handle] {
+ return handle.enter(write_pipeline->finalize);
+ });
+}
+
void Journal::RecordSubmitter::update_state()
{
if (num_outstanding_io == 0) {
return record_submitter.submit(std::move(record), handle);
}
+ /**
+ * flush
+ *
+ * Wait for all outstanding IOs on handle to commit.
+ * Note, flush() machinery must go through the same pipeline
+ * stages and locks as submit_record.
+ */
+ seastar::future<> flush(OrderingHandle &handle) {
+ return record_submitter.flush(handle);
+ }
+
/**
* Read deltas and pass to delta_handler
*
using submit_ret = Journal::submit_record_ret;
submit_ret submit(record_t&&, OrderingHandle&);
+ seastar::future<> flush(OrderingHandle &handle);
private:
void update_state();
});
}
+
+seastar::future<> SeaStore::flush(CollectionRef ch)
+{
+ return seastar::do_with(
+ get_dummy_ordering_handle(),
+ [this, ch](auto &handle) {
+ return handle.take_collection_lock(
+ static_cast<SeastoreCollection&>(*ch).ordering_lock
+ ).then([this, &handle] {
+ return transaction_manager->flush(handle);
+ });
+ });
+}
+
SeaStore::tm_ret SeaStore::_do_transaction_step(
internal_context_t &ctx,
CollectionRef &col,
CollectionRef ch,
ceph::os::Transaction&& txn) final;
+ /* Note, flush() machinery must go through the same pipeline
+ * stages and locks as do_transaction. */
+ seastar::future<> flush(CollectionRef ch) final;
+
seastar::future<OmapIteratorRef> get_omap_iterator(
CollectionRef ch,
const ghobject_t& oid) final;
});
}
+seastar::future<> TransactionManager::flush(OrderingHandle &handle)
+{
+ return handle.enter(write_pipeline.reserve_projected_usage
+ ).then([this, &handle] {
+ return handle.enter(write_pipeline.ool_writes);
+ }).then([this, &handle] {
+ return handle.enter(write_pipeline.prepare);
+ }).then([this, &handle] {
+ handle.maybe_release_collection_lock();
+ return journal->flush(handle);
+ });
+}
+
TransactionManager::get_next_dirty_extents_ret
TransactionManager::get_next_dirty_extents(
Transaction &t,
submit_transaction_direct_ret submit_transaction_direct(
Transaction &t) final;
+ /**
+ * flush
+ *
+ * Block until all outstanding IOs on handle are committed.
+ * Note, flush() machinery must go through the same pipeline
+ * stages and locks as submit_transaction.
+ */
+ seastar::future<> flush(OrderingHandle &handle);
+
using SegmentCleaner::ExtentCallbackInterface::get_next_dirty_extents_ret;
get_next_dirty_extents_ret get_next_dirty_extents(
Transaction &t,