diff --git a/replica/table.cc b/replica/table.cc index ec5dcae728..efcdecca0d 100644 --- a/replica/table.cc +++ b/replica/table.cc @@ -1657,6 +1657,17 @@ table::try_flush_memtable_to_sstable(compaction_group& cg, lw_shared_ptr future<> { + const auto this_table_name = format("{}.{}", _schema->ks_name(), _schema->cf_name()); + if (this_table_name == handler.get("table_name")) { + tlogger.info("error injection handler replica_post_flush_after_update_cache: suspending flush for table {}", this_table_name); + handler.set("suspended", true); + co_await handler.wait_for_message(std::chrono::steady_clock::now() + std::chrono::minutes{5}); + tlogger.info("error injection handler replica_post_flush_after_update_cache: resuming flush for table {}", this_table_name); + } + }); + cg.memtables()->erase(old); tlogger.debug("Memtable for {}.{} replaced, into {} sstables", old->schema()->ks_name(), old->schema()->cf_name(), newtabs.size()); co_return;