From c975882e039cb03f7cb3ceecaa271fa903c1926f Mon Sep 17 00:00:00 2001 From: Asias He Date: Tue, 29 Oct 2024 09:27:39 +0800 Subject: [PATCH] network_topology_strategy: Preserve fields of task_info in reallocate_tablets So other fields will not be dropped when the new tablet is created. --- locator/network_topology_strategy.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/locator/network_topology_strategy.cc b/locator/network_topology_strategy.cc index 25841cb939..10f158e815 100644 --- a/locator/network_topology_strategy.cc +++ b/locator/network_topology_strategy.cc @@ -353,8 +353,9 @@ future network_topology_strategy::reallocate_tablets(schema_ptr s, t tablet_logger.debug("Allocating tablets for {}.{} ({}): dc_rep_factor={} tablet_count={}", s->ks_name(), s->cf_name(), s->id(), _dc_rep_factor, tablets.tablet_count()); for (tablet_id tb : tablets.tablet_ids()) { - auto replicas = co_await reallocate_tablets(s, tm, load, tablets, tb); - tablets.set_tablet(tb, tablet_info{std::move(replicas)}); + auto tinfo = tablets.get_tablet_info(tb); + tinfo.replicas = co_await reallocate_tablets(s, tm, load, tablets, tb); + tablets.set_tablet(tb, std::move(tinfo)); } tablet_logger.debug("Allocated tablets for {}.{} ({}): dc_rep_factor={}: {}", s->ks_name(), s->cf_name(), s->id(), _dc_rep_factor, tablets);