tablets: fall back to full partition read when tablet map is missing

When update_tablet_metadata receives a hint with non-empty tokens for a
table whose tablet map doesn't exist locally yet, it would call
mutate_tablet_map_async which throws no_such_tablet_map. This happens
during bootstrap when the joining node receives tablet metadata for a
table it has never seen before.

Fix by checking has_tablet_map() before attempting the point update. If
the map is missing, fall back to do_update_tablet_metadata_partition
which reads the full partition from system.tablets and creates the map.
This commit is contained in:
Aleksandra Martyniuk
2026-05-27 14:35:18 +02:00
parent d6c1707a04
commit 491db28fbf

View File

@@ -1062,7 +1062,7 @@ future<> update_tablet_metadata(replica::database& db, cql3::query_processor& qp
try {
for (const auto& [_, table_hint] : hint.tables) {
if (table_hint.full_read || table_hint.tokens.empty()) {
if (table_hint.full_read || table_hint.tokens.empty() || !tm.has_tablet_map(table_hint.table_id)) {
co_await do_update_tablet_metadata_partition(qp, tm, table_hint, builder);
} else {
co_await tm.mutate_tablet_map_async(table_hint.table_id, [&] (tablet_map& tmap) -> future<> {