From c6d0bc87d024addd62962892d64b04410089cbd7 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Thu, 19 May 2022 14:29:18 +0300 Subject: [PATCH] azure_snitch: Do nothing on non-io-cpu All snitch drivers are supposed to snitch info on some shard and replicate the dc/rack info across others. All, but azure really do so. The azure one gets dc/rack on all shards, which's excessive but not terrible, but when all shards start to replicate their data to all the others, this may lead to use-after-frees. fixes: #10494 Signed-off-by: Pavel Emelyanov --- locator/azure_snitch.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/locator/azure_snitch.cc b/locator/azure_snitch.cc index 5a0e38db6d..fc70436d92 100644 --- a/locator/azure_snitch.cc +++ b/locator/azure_snitch.cc @@ -31,6 +31,10 @@ azure_snitch::azure_snitch(const snitch_config& cfg) : production_snitch_base(cf } future<> azure_snitch::load_config() { + if (this_shard_id() != io_cpu_id()) { + co_return; + } + sstring region = co_await azure_api_call(REGION_NAME_QUERY_PATH); sstring azure_zone = co_await azure_api_call(ZONE_NAME_QUERY_PATH);