Quick revision
The short answer
The rebalance reads huge volumes from the original nodes' disks and network while they still serve requests, and the new nodes compact what they receive, so unthrottled background streaming crowded out foreground reads and pushed p99 from 8 to 140 ms. We stop the damage by pausing or throttling the moves with the database's streaming or recovery limits, then run the expansion off-peak in small batches with watched latency and a written abort rule, move non-leader replicas first, and in future add capacity at 60 to 70 percent utilisation rather than when the cluster is already busy.
What to remember
In this answer, we saw that a rebalance streams data from the same disks and networks that serve users, so 9 TB moved without limits filled the disk queues and pushed p99 from 8 ms to 140 ms, made worse by compaction on the receivers and client retries. We stopped the damage with the database's streaming or recovery throttles, or a pause, estimated that the move takes hours at a safe rate, and ran it off-peak in small batches with an abort rule, copying non-leader replicas first and moving leadership afterwards. Above all, expansion should start at 60 to 70 percent utilisation, not when the cluster is already struggling.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
The rebalance reads huge volumes from the original nodes' disks and network while they still serve requests, and the new nodes compact what they receive, so unthrottled background streaming crowded out foreground reads and pushed p99 from 8 to 140 ms. We stop the damage by pausing or throttling the moves with the database's streaming or recovery limits, then run the expansion off-peak in small batches with watched latency and a written abort rule, move non-leader replicas first, and in future add capacity at 60 to 70 percent utilisation rather than when the cluster is already busy.
Why this question is asked
Adding nodes is supposed to make a cluster faster, and here it made it much slower within minutes. That surprise is common, because the act of adding capacity uses the same disks and networks that serve users. Interviewers ask this debugging scenario because it tests whether we know where the work of a rebalance actually happens, which controls a database gives us, and how to plan a risky operation. In this answer, we will explain why the rebalance hurt, stop the damage, estimate how long the move really takes, run the expansion safely, and decide when expansions should happen.
1A Quick Recap: What a Rebalance Does
When nodes join a partitioned database, some partitions are reassigned to them. For each reassigned partition, the new node must receive a full copy of its data, streamed from a node that already holds it, usually one of the existing replicas. Only after the copy is complete and caught up does the new node start serving that partition, and the old copy is then removed. So 9 TB of data moving means 9 TB read from the original nodes' disks, sent over their network links, and written on the new nodes.
2Why Foreground Reads Suffered
The original 12 nodes were doing two jobs at once. Their disks were serving user reads, many of them random reads that need low latency, and at the same time large sequential reads for streaming. Streaming is efficient at using a disk; without a limit, it takes as much bandwidth and as many I/O operations as the disk can give. User reads then wait in the same disk queue behind streaming reads, and disk utilisation at 100 percent is the sign. Latency at the tail grows first, because the slowest reads are the ones stuck behind the largest batches, which is why p99 jumped from 8 ms to 140 ms while the median moved less.
The network adds to it: streaming saturates the source nodes' outbound links, delaying responses. And on the receiving side, many databases write incoming data as files that then need compaction, which uses CPU and disk on the new nodes, and those new nodes may already be receiving some traffic. Once latency rises above client timeouts, clients retry, adding more load to the already busy nodes.
- Operator adds 4 nodesrebalance starts moving 9 TB
- Original nodes stream at full disk speedlarge sequential reads
- User reads queue behind streaming I/Odisks at 100 percent
- p99 read latency 8 ms -> 140 mstail suffers first
- Clients time out and retrymore load on the same nodes
5 steps in order. Play them, or step through them one at a time.
3Stopping the Damage Now
The first action is to reduce the background work, not to add more nodes or restart anything. Most distributed databases let us pause or throttle data movement at runtime. The settings have different names in each product, so we check the exact ones for our version, but they look like this.
If throttling is not enough, we pause the moves entirely, for example by disabling rebalancing or allocation in Elasticsearch, until latency recovers, and resume with a lower limit later. We watch p99 latency and disk utilisation as we turn the knob; the goal is a level where streaming makes steady progress and user latency stays within its target. We also check whether clients are retrying aggressively, because a retry storm can keep latency high even after streaming slows.
4Estimating How Long the Move Really Takes
A throttle trades speed for safety, so we do the arithmetic before choosing it. Suppose each of the 12 source nodes can stream at 50 MB/s without hurting users, about 600 MB/s for the cluster. Then 9 TB takes 9,000,000 MB / 600 MB/s = 15,000 seconds, a little over 4 hours, assuming perfect parallelism, which real moves never achieve. At 200 MB/s for a single stream, the same data would take 12.5 hours. Either way, this is an operation measured in hours, and planning it as if it took minutes was the original mistake.
This estimate tells us whether to run it in one night or over several, and it sets expectations: an expansion that must finish today because disks are nearly full is a much more dangerous operation than one that can take a week.
| Limit | Cluster-wide rate | Approximate duration |
|---|---|---|
| Unthrottled (what happened) | disk-bound, 1+ GB/s | a few hours, but users suffer |
| 50 MB/s per source node x 12 | 600 MB/s | about 4 to 5 hours |
| 200 MB/s, one stream | 200 MB/s | about 12.5 hours |
| 20 MB/s per source node x 12 | 240 MB/s | about 10 to 11 hours |
5Running the Expansion Safely
A safe expansion is a planned sequence of small steps. We run it off-peak, moving a small batch of partitions at a time rather than everything at once, and after each batch we check p99 latency, disk utilisation, and progress against the estimate. Before starting, we write down the abort rule, for example: pause if p99 read latency exceeds 20 ms for 5 minutes, so the decision under pressure is already made.
Order matters too. In systems with leaders or primaries, such as Kafka or Elasticsearch, we first copy data as non-leader replicas, which only receive data and do not serve the main traffic, and only once the copies are complete do we shift leadership or primaries to the new nodes, which is a fast metadata change. That separates the heavy data movement from the moment traffic changes nodes. And we keep client retries bounded with backoff, so a brief latency increase does not multiply into load.
6Adding Capacity Before It Is Urgent
The deeper lesson is about timing. Moving data needs spare disk bandwidth, network and CPU on the nodes that are already serving. A cluster running at 90 percent of its capacity has almost none, so expanding it is both most urgent and most dangerous. We set the trigger for expansion well before that, for example when disk use or peak CPU reaches 60 to 70 percent, so the move can run slowly and safely. Capacity forecasts based on growth rates turn expansion into routine, scheduled work rather than an emergency at 14:00 on a weekday.
7Follow-up questions
Why did the median latency rise less than p99?
Most reads still found the disk free or waited briefly. The slowest reads were those that arrived behind large streaming I/O operations or during compaction bursts, and p99 measures exactly those. Background work almost always shows up at the tail first, which is why p99 or p999 is the metric to watch during data movement.
Would adding the nodes one at a time have helped?
It spreads the work over time, which helps, but each join still streams its share at full speed unless throttled. The throttle is what protects foreground traffic; the batch size controls how long each period of risk lasts and how much we can stop at once.
What should the new nodes do while they receive data?
Ideally serve nothing for the partitions still being copied, which most systems ensure, and have compaction throttled so they do not fall behind. Their own disks are also under heavy write load during this time.
8Conclusion
In this answer, we saw that a rebalance streams data from the same disks and networks that serve users, so 9 TB moved without limits filled the disk queues and pushed p99 from 8 ms to 140 ms, made worse by compaction on the receivers and client retries. We stopped the damage with the database's streaming or recovery throttles, or a pause, estimated that the move takes hours at a safe rate, and ran it off-peak in small batches with an abort rule, copying non-leader replicas first and moving leadership afterwards. Above all, expansion should start at 60 to 70 percent utilisation, not when the cluster is already struggling.
Open with
The rebalance and the users were fighting over the same disks. To move 9 TB, the original nodes stream large sequential reads from their disks and push them over the network, while still serving user reads, and the new nodes compact what they receive.
Then, if they want more
Without a limit, streaming takes all the disk bandwidth, user reads queue behind it, utilisation hits 100 percent, and the tail goes first: p99 from 8 to 140 milliseconds, then timeouts and retries that add even more load.
First I would throttle or pause the moves using the database's controls, like nodetool setstreamthroughput in Cassandra, indices.recovery.max_bytes_per_sec and concurrent recoveries in Elasticsearch, or the reassignment throttle in Kafka, and watch p99 and disk utilisation until latency recovers.
Then I would do the arithmetic: at a safe rate of, say, 600 megabytes per second for the cluster, 9 TB takes four to five hours at best, so this is an overnight operation, not a 14:00 click.
I would run it off-peak, in small batches of partitions, with a written abort criterion such as p99 above 20 milliseconds for five minutes. I would move data as non-leader replicas first and shift leadership afterwards.
And for the future, trigger expansions at 60 to 70 percent of disk or CPU, because moving data on a cluster already near its limits is the most dangerous time.
About this answer
- Last updated
- 13 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Explain why the rebalance hurt foreground traffic, how you would stop the damage, and...": https://scrivio-interview-library.netlify.app/architecture/partitioning-and-replication/567953cb31/