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.
This commit is contained in:
Tomasz Grabiec
2023-09-22 19:02:10 +02:00
parent 6cd310fc1a
commit 2d4cd9c574

View File

@@ -1695,10 +1695,10 @@ table::table(schema_ptr schema, config config, lw_shared_ptr<const storage_optio
}
void table::update_effective_replication_map(locator::effective_replication_map_ptr erm) {
if (_erm) {
_erm->invalidate();
auto old_erm = std::exchange(_erm, std::move(erm));
if (old_erm) {
old_erm->invalidate();
}
_erm = std::move(erm);
}
partition_presence_checker