Kafka Adaptive Balancer Goals and Cluster Model
The AxonOps Kafka Adaptive Balancer decides what to move by running a set of goals against a cluster model. Each goal describes one property of a balanced cluster, such as every replica of a partition sitting on a different rack, or disk usage staying within a band around the cluster mean, and proposes the moves that bring the model closer to it. The balancer follows the goal-based model of Cruise Control, the open-source Kafka rebalancing project, and uses Cruise Control’s goal names where a goal is equivalent. It is a separate implementation: it does not run Cruise Control or use Cruise Control’s REST API.
- Hard goals express constraints. A hard goal that cannot be satisfied fails the analysis, unless the analysis runs with Skip hard-goal pre-check.
- Soft goals express preferences. They improve balance as far as the hard goals and earlier soft goals allow, and never fail an analysis.
- Thresholds set how strict each goal is. They are global to the balancer and set in its configuration file.
- The cluster model is the load and capacity data the goals work on. It is built from AxonOps metrics and topology, and its accuracy limits the quality of every proposal.
The operator workflow for running analyses and enabling goals is described in Rebalancing a Kafka Cluster with the Adaptive Balancer.
How goals work
Section titled “How goals work”Run order
Section titled “Run order”An analysis runs the enabled goals one at a time, hard goals first, then soft goals, in a fixed built-in order. The order is the order of the goal reference table below. Within the soft goals, the layout goals (DrainGoal, ReplicaDistributionGoal, LeaderReplicaDistributionGoal) run before the load goals (disk, network, and CPU distribution), so that a drain or a replica count rebalance is not blocked by load goals when the load signal is weak or uniform.
The order cannot be changed. The Goals page in axon-dash allows rows to be dragged, but only the enabled state of each goal is kept; see Managing goals. The default_goals list and its order in the balancer configuration file do not select or order the goals analyses use either.
Checks between goals
Section titled “Checks between goals”Each goal works on a copy of the cluster model and proposes actions: replica moves, leader changes, and swaps of replicas between two brokers. Every action is checked against the goals that have already run. An action that would break the property of an earlier goal is rejected, and the rejection is counted in the analysis’s Rejection Summary under the goal that proposed it and the goal that rejected it. A later goal therefore cannot undo the work of an earlier one, and hard goals, running first, check every soft goal’s actions.
When some of a goal’s actions are rejected, the goal runs again against the updated model to look for other destinations, up to 3 passes in total. A goal that does not reach its target still checks the goals after it, so that later goals do not undo the progress it made.
Four analysis conditions change how actions are checked:
- Moves off a broker in a maintenance window with Drain on are not checked by soft goals. Hard goals still check them.
- With Disable leadership moves on, deliberate leader changes are rejected and counted in the Rejection Summary as
<leadership-moves-disabled>. - A partition with a replication factor of 1 is moved only off a draining or dead broker, unless Allow single-replica moves is on.
- A broker listed in Excluded brokers is frozen: any replica, leadership, or disk move with that broker as its source or destination is rejected and counted in the Rejection Summary as
<excluded-broker>with the verdictBROKER_FROZEN. See Excluded brokers.
How goals choose moves
Section titled “How goals choose moves”The capacity goals for CPU and outbound network first try leader changes, which shift load without copying data, and then move replicas. The other capacity goals move replicas only. The usage distribution goals first move load off brokers above their band (with leader changes first for CPU and outbound network), then try swapping replicas between two brokers when a plain move is rejected, and finally move load onto brokers below the band.
From goals to proposals
Section titled “From goals to proposals”When the last goal has run, the balancer compares the original model with the final one. Each partition whose set of brokers changed produces one replica move carrying the partition’s full target replica list, with the new leader first; its data to move is the partition size multiplied by the number of new replicas. A partition whose leader changed produces a leader change when its set of brokers is unchanged, or when the old leader keeps a replica. Where a replica move removes the old leader, no separate leader change is needed, because Kafka elects a new leader from the target replicas when the reassignment completes. Moves between disks of the same broker are listed separately as disk moves. The analysis has no limit on the number of proposals or the amount of data to move.
When an analysis fails
Section titled “When an analysis fails”A hard goal that returns an error fails the analysis, and the goal’s message appears in the Error field of the analysis page. With Skip hard-goal pre-check on, the same error is recorded under Violated goals (after) instead, the goal is skipped for the rest of the run, and the analysis continues; see Rack awareness for the consequences. A soft goal that returns an error is always recorded and skipped.
| Error text contains | Cause | Remedy |
|---|---|---|
[RackAwareGoal] Insufficient number of racks: <n> alive, but the largest replication factor is <m> | Fewer racks than the largest replication factor | Disable RackAwareGoal and enable RackAwareDistributionGoal, or add racks |
[<goal>] Insufficient capacity for resource <resource> | The total load exceeds the capacity threshold multiplied by the total capacity of the brokers that can receive replicas | Check the capacities in the model (see Broker capacities), add brokers, or clear maintenance windows and excluded brokers |
[<goal>] unable to fix capacity violation for broker <id> | A broker is over its capacity threshold and no accepted move brings it below | Check the broker’s capacity in the model, and the Rejection Summary for the goals that blocked the moves |
[<goal>] All alive brokers are excluded from replica moves | Every live broker is excluded or in a maintenance window | Remove exclusions or maintenance windows |
Goal reference
Section titled “Goal reference”The following table lists every goal the balancer implements, in run order. Enabled by default gives the state for a newly registered cluster; the enabled goals for a cluster are changed on the Goals page and stored per cluster.
| Goal | Type | Optimises | Threshold (key: default) | Enabled by default |
|---|---|---|---|---|
| RackAwareGoal | Hard | Places every replica of a partition on a different rack, and moves replicas off dead brokers. Fails when the largest replication factor exceeds the number of live racks. | None | ✅ |
| RackAwareDistributionGoal | Hard | Spreads each partition’s replicas as evenly as possible across racks. Same placement as RackAwareGoal when there are at least as many racks as the replication factor; does not fail when there are fewer. | None | ❌ |
| ReplicaCapacityGoal | Hard | Caps the number of replicas on each broker. | max_replicas_per_broker: 10000 | ✅ |
| DiskCapacityGoal | Hard | Keeps each broker’s disk utilisation below the threshold. | capacity_threshold.disk: 0.8 | ✅ |
| NetworkInboundCapacityGoal | Hard | Keeps inbound network utilisation of each host below the threshold. | capacity_threshold.network_in: 0.8 | ✅ |
| NetworkOutboundCapacityGoal | Hard | Keeps outbound network utilisation of each host below the threshold. | capacity_threshold.network_out: 0.8 | ✅ |
| CpuCapacityGoal | Hard | Keeps each broker’s CPU utilisation below the threshold. | capacity_threshold.cpu: 0.7 | ✅ |
| IntraBrokerDiskCapacityGoal | Hard | Caps usage of each log directory within a broker, for JBOD (just a bunch of disks) layouts with several log directories on separate disks. Its disk moves are not applied; keep it disabled. | capacity_threshold.disk: 0.8 | ❌ |
| DrainGoal | Soft | Moves every replica off brokers in a maintenance window with Drain on, each to the least-loaded eligible broker. | None | ✅ |
| ReplicaDistributionGoal | Soft | Keeps the replica count of each broker within a band around the mean. | replica_balance_percentage: 0.09 | ✅ |
| LeaderReplicaDistributionGoal | Soft | Keeps the leader count of each broker within a band around the mean. | leader_replica_balance_percentage: 0.09 | ✅ |
| DiskUsageDistributionGoal | Soft | Keeps each broker’s disk utilisation within a band around the mean. | resource_balance_percentage.disk: 0.09 | ✅ |
| NetworkInboundUsageDistributionGoal | Soft | Keeps inbound network utilisation within a band around the mean. | resource_balance_percentage.network_in: 0.09 | ✅ |
| NetworkOutboundUsageDistributionGoal | Soft | Keeps outbound network utilisation within a band around the mean. | resource_balance_percentage.network_out: 0.09 | ✅ |
| CpuUsageDistributionGoal | Soft | Keeps CPU utilisation within a band around the mean. | resource_balance_percentage.cpu: 0.09 | ✅ |
| LeaderBytesInDistributionGoal | Soft | Balances the inbound byte rate of leader replicas across brokers. | resource_balance_percentage.network_in: 0.09 | ❌ |
| PotentialNwOutGoal | Soft | Keeps each broker’s outbound network below the threshold in the worst case, where every follower replica on it became a leader. | capacity_threshold.network_out: 0.8 | ❌ |
| TopicReplicaDistributionGoal | Soft | Spreads each topic’s replicas evenly across brokers. | topic_replica_balance_percentage: 3.0; topic_replica_balance_min_gap: 2; topic_replica_balance_max_gap: 40 | ❌ |
| PreferredLeaderElectionGoal | Soft | Proposes a leader change wherever a partition’s current leader is not its preferred leader (the first replica in its list). | None | ❌ |
Legend: ✅ enabled for a newly registered cluster | ❌ disabled for a newly registered cluster.
With the default goals, an analysis runs in this order: RackAwareGoal, ReplicaCapacityGoal, DiskCapacityGoal, NetworkInboundCapacityGoal, NetworkOutboundCapacityGoal, CpuCapacityGoal, DrainGoal, ReplicaDistributionGoal, LeaderReplicaDistributionGoal, DiskUsageDistributionGoal, NetworkInboundUsageDistributionGoal, NetworkOutboundUsageDistributionGoal, CpuUsageDistributionGoal.
The goals that are off by default are enabled on the Goals page when needed:
- RackAwareDistributionGoal replaces RackAwareGoal on a cluster with fewer racks than its largest replication factor; see Rack awareness.
- IntraBrokerDiskCapacityGoal should stay disabled. The cluster model has one disk capacity per broker, so JBOD layouts are not modelled per disk, and the disk moves the goal proposes are recorded as completed without moving data.
- PreferredLeaderElectionGoal produces leader changes, which take effect only when Kafka runs a preferred leader election. The Goals page description says the goal triggers elections; the balancer cannot start one. See Leader changes.
Disabling every goal on the Goals page does not stop analyses: when no goal is enabled, the balancer enables all of the goals above for the next analysis. At least one goal should remain enabled.
Rack awareness
Section titled “Rack awareness”The balancer reads each broker’s rack from the broker.rack broker setting (Kafka Improvement Proposal KIP-36, Apache Kafka 0.10.0 and later), as reported by AxonOps. A broker without broker.rack is treated as its own rack named after its host, so that brokers on the same host share a rack; a broker with no host name is given a rack of its own. On a cluster with no broker.rack settings, rack goals therefore keep replicas of a partition on different hosts.
Two rack goals exist, and exactly one should be enabled. Both are hard goals.
| Behaviour | RackAwareGoal | RackAwareDistributionGoal |
|---|---|---|
| Racks at least equal to the largest replication factor | Every replica of a partition on a different rack | Same placement as RackAwareGoal |
| Fewer racks than the largest replication factor | Fails every analysis | Each rack holds at least ⌊replication factor ÷ number of racks⌋ replicas of a partition, and (replication factor mod number of racks) racks hold one more |
| Enabled by default | ✅ | ❌ |
Legend: ✅ enabled for a newly registered cluster | ❌ disabled for a newly registered cluster.
Topics listed in Excluded topics are left out when the largest replication factor is determined, but excluding a topic does not change the number of racks.
A cluster should switch from RackAwareGoal to RackAwareDistributionGoal when its number of racks, or hosts where broker.rack is unset, is smaller than the largest replication factor of any topic. For example, a three-rack cluster with a topic at replication factor 4 fails every analysis under RackAwareGoal, because four replicas cannot be on four different racks. To switch, turn off RackAwareGoal and turn on RackAwareDistributionGoal on the Goals page. RackAwareDistributionGoal keeps the partition as evenly spread as the racks allow, and rejects a later goal’s move that would make the spread less even.
Skip hard-goal pre-check is the other way to analyse such a cluster, and the weaker one. With it on, the balancer skips the check for hard-goal violations before the run, and a hard goal that returns an error is recorded under Violated goals (after) and skipped for the rest of the run. A skipped goal no longer checks the actions of later goals, so it stops protecting its property for that analysis: with RackAwareGoal skipped, the proposals may place two replicas of a partition on the same rack. The option applies to every hard goal, including the capacity goals, whose skipping allows proposals that take a broker past its capacity threshold. Review Violated goals (after) on every analysis run with this option.
Capacity and distribution thresholds
Section titled “Capacity and distribution thresholds”Thresholds are set in the global_optimization.thresholds section of the balancer configuration file. An unset key keeps its default. The values apply to every cluster the balancer manages; there is no per-cluster override. The balancer reads the file at startup, so a change takes effect after a restart. Values are not range-checked, and unknown keys are ignored without a warning. The file format and location are described in Kafka Adaptive Balancer Configuration Reference.
| Key | Default | Used by | Meaning |
|---|---|---|---|
capacity_threshold.cpu | 0.7 | CpuCapacityGoal | Largest fraction of a broker’s CPU capacity it may use |
capacity_threshold.disk | 0.8 | DiskCapacityGoal, IntraBrokerDiskCapacityGoal | Largest fraction of a broker’s disk capacity it may use |
capacity_threshold.network_in | 0.8 | NetworkInboundCapacityGoal | Largest fraction of a host’s inbound network capacity it may use |
capacity_threshold.network_out | 0.8 | NetworkOutboundCapacityGoal, PotentialNwOutGoal | Largest fraction of a host’s outbound network capacity it may use |
resource_balance_percentage.cpu, .disk, .network_in, .network_out | 0.09 each | The usage distribution goals, LeaderBytesInDistributionGoal (network_in) | Width of the band around the mean utilisation, relative to the mean |
low_utilization_threshold.cpu, .disk, .network_in, .network_out | 0.0 each | The usage distribution goals | When the mean utilisation is at or below this value, the goal reports the cluster as over-provisioned; this does not change the proposals |
replica_balance_percentage | 0.09 | ReplicaDistributionGoal | Width of the band around the mean replica count per live broker |
leader_replica_balance_percentage | 0.09 | LeaderReplicaDistributionGoal | Width of the band around the mean leader count per live broker |
topic_replica_balance_percentage | 3.0 | TopicReplicaDistributionGoal | A ratio of 1 or more, not a fraction: how far above the topic’s average replicas per broker a broker may go |
topic_replica_balance_min_gap, topic_replica_balance_max_gap | 2, 40 | TopicReplicaDistributionGoal | Smallest and largest allowed gap, in replicas, between a broker’s count for a topic and the topic’s average |
max_replicas_per_broker | 10000 | ReplicaCapacityGoal | Most replicas one broker may hold; the lower of this value and the broker’s replica capacity (10000) applies |
The capacity thresholds are checked on every move: a move is rejected when the destination’s projected utilisation would reach or exceed the threshold. Network capacity is checked per host, so brokers that share a host share its network capacity.
The balance percentages are relative to the mean, not percentage points. With the default 0.09 and a mean disk utilisation of 50%, DiskUsageDistributionGoal aims to keep every broker between 45.5% and 54.5%. The replica and leader count bands are rounded outward: with a mean of 100 replicas per broker, the band is 91 to 109 replicas.
The following example raises the CPU threshold and narrows the disk band, leaving every other threshold at its default:
global_optimization: thresholds: capacity_threshold: cpu: 0.8 resource_balance_percentage: disk: 0.05The cluster model
Section titled “The cluster model”The cluster model is the balancer’s in-memory picture of one Kafka cluster: its brokers and racks, every partition and replica, the load each replica carries, and the capacity of each broker. Every analysis works on it, and every proposal is only as accurate as the model behind it.
Model refresh
Section titled “Model refresh”The balancer rebuilds the model of each cluster every model refresh interval, 5 minutes by default, and when a maintenance window changes, when Force refresh is selected, and when an analysis starts with a model older than 30 seconds. The model refresh interval (30 seconds to 6 hours) and the metrics window (1 minute to 7 days, default 1 hour) are set per cluster under Settings → Kafka; see Kafka Adaptive Balancer Configuration Reference.
A rebuild reads the brokers, topics, and partitions from axon-server, with one request per topic, and then queries the metrics below over the metrics window. A rebuild that receives an empty broker list from axon-server, which can happen briefly while a broker shuts down, is skipped: the balancer keeps the previous model, so the brokers are not reported dead, and logs “AxonOps returned an empty broker list for org=… cluster=…; skipping this refresh rather than modelling every broker as dead” within a “Failed to refresh cluster model” entry. The balancer retries after half the refresh interval and shows the cluster Status as ERROR on the Overview, with the reason in the Error row, in the meantime. Any other failure to read a metric does not fail the rebuild (see Missing and incomplete metrics).
Metrics used
Section titled “Metrics used”The model reads the following AxonOps metrics. They are collected by the AxonOps Kafka agent and the axon-agent host collectors.
| Model input | AxonOps metric | Reduction |
|---|---|---|
| Broker CPU | host_CPU_Percent_Merge (real time), per host | Mean over the metrics window |
| Broker log size | kaf_Log_Size, summed per host | Latest sample |
| Partition size | kaf_Log_Size, per topic and partition | Latest sample |
| Broker network in and out | kaf_BrokerTopicMetrics_BytesInPerSec and kaf_BrokerTopicMetrics_BytesOutPerSec, FiveMinuteRate, summed per host | Mean over the metrics window |
| Replication traffic, added to network load | kaf_BrokerTopicMetrics_ReplicationBytesInPerSec and kaf_BrokerTopicMetrics_ReplicationBytesOutPerSec, MeanRate | MeanRate is the average since the broker started, not over the metrics window |
| Topic byte rates | kaf_BrokerTopicMetrics_BytesInPerSec and kaf_BrokerTopicMetrics_BytesOutPerSec, FiveMinuteRate, per topic | Mean over the metrics window |
| Under-replicated partitions | kaf_Partition_UnderReplicated | Latest sample, non-zero |
| Disk capacity per mount point | host_Disk_Used, host_Disk_UsedPercent | Latest sample |
| Disk read and write rates | host_Disk_SectorsRead, host_Disk_SectorsWrite (rate) | Shown in the Flow diagram only |
| I/O wait | host_CPU in iowait mode, divided by total host_CPU | Mean over the metrics window |
Rates are averaged over the metrics window, and sizes come from the latest sample. A wider window smooths short spikes out of the rates but makes the model slower to reflect a change in traffic, including the change made by an execution. AxonOps stores long ranges at a lower resolution, so a 7-day window is averaged over samples 720 seconds apart.
How load is derived
Section titled “How load is derived”Kafka has no per-partition byte-rate metric, so the balancer derives one. Each partition’s inbound and outbound rates are its topic’s rates multiplied by the partition’s share of the topic’s total size. Every replica of a partition carries the partition’s inbound rate, because followers replicate what the leader receives; only the leader carries the outbound rate. A topic whose partitions receive traffic out of proportion to their size, for example because of a skewed message key, is therefore modelled with the wrong load per partition.
A broker’s measured CPU is divided among its replicas by weight: leader bytes in 0.7, leader bytes out 0.15, follower bytes in 0.15. Moving every replica off a broker therefore removes all of its modelled CPU load. On a broker with no traffic, the CPU is treated as overhead that no replica carries. CPU is host CPU, not the Kafka process’s CPU, so other processes on the host count as broker load.
A broker’s disk load is the sum of the sizes of its replicas. Data on the same filesystem that the balancer cannot move, such as the KRaft __cluster_metadata log or files outside Kafka, is not counted as load.
Broker capacities
Section titled “Broker capacities”| Resource | Capacity |
|---|---|
| CPU | 100% of the host’s CPU |
| Disk | Size of the filesystem holding the broker’s first log directory, as reported by the agent (source log.dirs). Where the agent reports none, the smallest filesystem whose used space is at least 95% of the broker’s log size (source inferred). Where neither is known, 1 TiB. The Disk mount analysis option overrides this for one analysis. |
| Network | The network speed AxonOps reports for the node, where one is reported. Otherwise, 1 GiB/s per broker in each direction is assumed. Summed per host for the network goals. |
| Replicas | 10000 per broker |
The disk source of each broker appears in the hint beside the Disk mount option on the Analyses page. Where the 1 GiB/s network default applies to a host with faster interfaces, the network goals over-state that host’s utilisation unless capacity_threshold.network_in and capacity_threshold.network_out are adjusted to compensate. On slower interfaces, they under-state it.
Brokers with high I/O wait have their capacity reduced. Above 20% I/O wait, the disk and inbound network capacities are scaled down linearly, reaching the maximum reduction of 50% at 60% I/O wait. The reduction makes the load on a slow broker a larger fraction of its capacity, so the goals move load away from it. When every broker has the same I/O wait, the reduction is the same everywhere and changes nothing.
Missing and incomplete metrics
Section titled “Missing and incomplete metrics”A metric that cannot be read produces a warning in the balancer log and does not fail the rebuild. The affected resource is modelled with zero load, and default capacities apply. Where some brokers have no sample for a resource, the balancer logs the warning “No metric sample for some brokers; their load for this resource is unknown”, naming the brokers. The analysis then proposes moves on incomplete data without reporting it on the analysis page. The load imbalance anomaly detector ignores brokers without a sample.
- When partition sizes are missing, the disk goals fall back to each broker’s measured log size.
- When topic byte rates are missing, every replica has zero network and CPU load, and the network and CPU goals cannot make progress.
- The agent reports topic names in metrics with
-and.replaced by_. The balancer maps them back to the real topic names, but cannot tell apart topics whose names differ only in those characters (for exampleorders.euandorders_eu); metrics for such topics are not attributed to either. - A broker whose AxonOps node is not classified as a Kafka broker, for example because the host also runs Schema Registry, is mapped to its host through the Kafka topology, so its host metrics are still used.
- No minimum amount of metric history is required. A newly monitored cluster is analysed on the samples the metrics window contains, however few.
The balancer log (/var/log/axonops/adaptive-balancer.log in a package installation) should be checked for metric warnings when an analysis produces unexpected proposals.
Under-replicated partitions and dead brokers
Section titled “Under-replicated partitions and dead brokers”A partition whose latest kaf_Partition_UnderReplicated sample is non-zero is marked offline in the model, together with all of its replicas, although Kafka is still serving it. Analyses should be run when the cluster has no under-replicated partitions, so that the model does not describe lagging replicas as offline.
A broker that appears in partition replica lists but is absent from the AxonOps topology, when AxonOps reports at least one broker, is treated as dead. Dead brokers receive no replicas and no leadership, and the goals move replicas off them. The balancer still proposes moving a partition with a replication factor of 1 off a dead broker even when Allow single-replica moves is off, because the partition is already unavailable. Such a movement generally cannot complete through Kafka’s reassignment path. The new replica has no leader to copy from, and with the default unclean.leader.election.enable=false it cannot join the in-sync replicas (ISR). The movement stalls and fails after movement_stall_timeout (5 minutes), as described in Failure semantics, unless the dead broker returns or an operator enables unclean leader election for the topic. Unclean leader election discards any data that was only on the dead replica.
The balancer’s API reports a health classification of its cluster model. It is not shown in the dashboard and is not a state that Kafka reports:
| Health | Condition in the cluster model |
|---|---|
HEALTHY | No dead brokers and no under-replicated partitions |
DEGRADED | Some partitions are under-replicated, no broker is dead, and under-replicated partitions are 10% of partitions or fewer |
UNHEALTHY | A broker is dead, or more than 10% of partitions are under-replicated |
UNKNOWN | No model refresh has completed yet |
The classification combines two conditions that affect the cluster differently:
- A dead broker is an availability event. Partitions it led are unavailable until Kafka elects a new leader from the remaining in-sync replicas. Partitions with no other in-sync replica, including every partition with a replication factor of 1 on that broker, stay unavailable until the broker returns, unless unclean leader election is enabled.
- Under-replicated partitions, whether they produce
DEGRADEDorUNHEALTHY, have a reduced replication margin. Kafka continues to serve them from their current leader. Producers that useacks=allreceive errors for a partition only when its in-sync replicas fall below the topic’smin.insync.replicas.
Cruise Control goals not implemented
Section titled “Cruise Control goals not implemented”The following Cruise Control goals have no equivalent in the balancer:
- MinTopicLeadersPerBrokerGoal
- BrokerSetAwareGoal
- IntraBrokerDiskUsageDistributionGoal
- The Kafka-assigner mode goals, KafkaAssignerDiskUsageDistributionGoal and KafkaAssignerEvenRackAwareGoal
A Cruise Control configuration that relies on these goals has no direct equivalent in the balancer’s goal set.
Related pages
Section titled “Related pages”- Kafka Adaptive Balancer: what the balancer does and how its components connect
- Rebalancing a Kafka Cluster with the Adaptive Balancer: running analyses, executing proposals, draining brokers, and enabling goals
- Kafka Adaptive Balancer Configuration Reference: the configuration file, including
global_optimization.thresholds - Kafka Adaptive Balancer Setup: installing the balancer and registering clusters
- Kafka cluster topology: configuring
broker.rackand rack-aware replica placement in Kafka