From 2d4cd9c57463ca2775c0cdfa79b96b27f0a71040 Mon Sep 17 00:00:00 2001 From: Tomasz Grabiec Date: Fri, 22 Sep 2023 19:02:10 +0200 Subject: [PATCH] tablets: Fix topology_metadata_guard holding on to the old erm Since abort callbacks are fired synchronously, we must change the table's erm before we do that so that the callbacks obtain the new erm. Otherwise, we will block barriers. --- replica/table.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/replica/table.cc b/replica/table.cc index d4042c5de8..249994536a 100644 --- a/replica/table.cc +++ b/replica/table.cc @@ -1695,10 +1695,10 @@ table::table(schema_ptr schema, config config, lw_shared_ptrinvalidate(); + auto old_erm = std::exchange(_erm, std::move(erm)); + if (old_erm) { + old_erm->invalidate(); } - _erm = std::move(erm); } partition_presence_checker