diff --git a/src/v/kafka/server/handlers/fetch.cc b/src/v/kafka/server/handlers/fetch.cc index 8e9b8390ab37..22dee67968c0 100644 --- a/src/v/kafka/server/handlers/fetch.cc +++ b/src/v/kafka/server/handlers/fetch.cc @@ -340,7 +340,9 @@ static ss::future do_read_from_ntp( kafka_partition->start_offset(), kafka_partition->high_watermark()); } - if (ntp_config.cfg.consumer_rack_id && kafka_partition->is_leader()) { + if ( + config::shard_local_cfg().enable_rack_awareness.value() + && ntp_config.cfg.consumer_rack_id && kafka_partition->is_leader()) { auto p_info_res = kafka_partition->get_partition_info(); if (p_info_res.has_error()) { // TODO: add mapping here