Scrivio Interview library
ScenarioAdvanced6 min read · updated 13 November 2026

A shared message queue cluster serves 120 teams. One team's producer bug sent 30 times its normal volume for 6 hours; broker disks reached 95 percent, produce latency for every team rose from 5 ms to 2 seconds, and two brokers went offline when their disks filled.

How do you recover the shared cluster, and what isolation would you build so one tenant's surge cannot take the others down?

To recover, throttle or block the offending producer by client id, shorten that topic's retention or truncate it with the owner's agreement, free space on the full brokers before restarting them, and watch under-replicated partitions while they catch up. To isolate tenants, enforce per-tenant quotas in the brokers for produce and fetch byte rates, request rates, partition counts and storage per topic, alert on forecast time to full rather than level, put large or critical tenants in separate broker groups or clusters, and move old segments to object storage with tiered storage. Afterwards, add onboarding with declared throughput, chargeback and a runbook for emergency quota changes.

Why this question is asked

A shared message cluster is efficient right up to the moment one tenant forgets it is shared. In this incident nothing was broken in the brokers; one producer bug simply consumed the disk and bandwidth that 119 other teams depended on. Interviewers ask this to see both incident skills, the order in which to act so recovery does not make things worse, and platform design, how to make tenants unable to hurt each other. In this answer, we will see how the surge spread to everyone, recover the cluster step by step, add per-tenant quotas, alert on forecasts, separate failure domains, and set up the processes that keep it healthy.

1How One Tenant Hurt 119 Others

At 30 times its normal volume for 6 hours, one team's topic grew enormously. If it normally produced 10 MB/s, the surge was 300 MB/s, about 6.5 TB of new data in 6 hours, times three replicas, nearly 20 TB of disk. Brokers share disks, network and request-handling threads between all topics on them. As disks filled toward 95 percent, the brokers spent more time on I/O, request queues grew, and produce latency rose from 5 ms to 2 seconds for everyone. When two brokers' disks filled completely, they could not write their logs and shut down, leaving their partitions with fewer replicas and moving leadership onto the remaining brokers, which raised their load further.

2Recovering the Cluster, in the Right Order

The first step is to stop the inflow. In Kafka, quotas can be applied to a client id or user at runtime, so we throttle the offending producer to a trickle or to zero without touching other tenants. Then we free space: with the owner's agreement, we shorten that topic's retention so the brokers delete its old segments, or delete records up to an offset, since 6 hours of buggy data is often worthless anyway.

Java
# 1. throttle the producer to 1 MB/s (by client id), takes effect without restarts
kafka-configs.sh --bootstrap-server b1:9092 --alter --entity-type clients \
--entity-name team-x-producer --add-config producer_byte_rate=1048576
# 2. with the owner's agreement, keep only the last hour of the topic
kafka-configs.sh --bootstrap-server b1:9092 --alter --entity-type topics \
--entity-name team-x-events --add-config retention.ms=3600000
# old segments are deleted on the next retention check -> disk use falls
Step throughRecovery order
  1. Throttle or block the producer by client idstop the inflow first
  2. Shorten retention or delete recordsonly with the owner's agreement
  3. Free space on the full brokersbefore any restart
  4. Restart the brokersthey rejoin and fetch missed data
  5. Under-replicated partitions back to zero?
    YesRestore normal settingsNoThrottle replication and keep watching

5 steps in order. Play them, or step through them one at a time.

Only then do we deal with the two offline brokers. Restarting a broker whose disk is still full just makes it fail again, so we first free space on it, for example by removing segments of the offending topic that are fully replicated elsewhere or by adding a volume, and then restart it. As it rejoins, it must copy everything it missed from the leaders, so we watch under-replicated partitions fall to zero and throttle replication traffic if catching up starts to hurt produce latency again.

3Per-Tenant Quotas in the Brokers

The lasting fix is that no tenant can consume more than its share. Brokers should enforce quotas per tenant, identified by authenticated user or client id: produce and fetch byte rates, and request rates, measured as a share of broker request-handling time so that tiny, very frequent requests cannot starve others. Kafka supports all three as client quotas, applied by throttling the client rather than failing it.

Storage needs limits too. Each topic gets a byte-based retention limit, retention.bytes per partition, so a surge rolls off its own oldest data instead of filling shared disks. Partition counts per tenant are capped through the platform's topic provisioning service or a create-topic policy in the brokers, since thousands of partitions also cost memory and recovery time. Note that byte-based retention deletes old data rather than rejecting new writes; if a team prefers rejection to data loss, that needs a provisioning-level storage quota or a quota plugin, so check what your platform supports.

4Alerting on the Forecast, Not Just the Level

Disk at 95 percent was the first alarm anyone saw, by which time there was no room to act. Alerts should fire on two things: a level well below full, 70 to 80 percent, and a projected time to full, calculated from the current growth rate. A cluster at 60 percent that will be full in three hours is far more urgent than one at 80 percent that will be full in three months.

Per-topic growth alerts point at the cause directly: a topic producing 30 times its usual rate for 15 minutes should page its owning team and the platform team long before disks are in danger, and a topic exceeding its storage quota should be stopped before a shared disk fills.

What the alerts would have said
SignalThresholdTime into the surge
team-x produce rate vs baselinemore than 5x for 15 minutes15 minutes
Projected cluster time to fullunder 12 hoursabout 30 minutes
Broker disk levelabove 75 percenta few hours
Broker disk level (old alarm)above 95 percentalmost 6 hours

5Separate Failure Domains and Tiered Storage

Quotas limit how much a tenant can take, but they do not separate failure domains: a broker bug triggered by one tenant's traffic still hits everyone on that broker. So large or critical tenants get separate broker groups within a cluster, by placing their partitions on dedicated brokers, or their own clusters. Payments and orders should not share brokers with an experimental analytics feed. Failure domains then follow importance.

Tiered storage lowers disk pressure further. Brokers keep only recent segments on local disk and move older segments to object storage such as S3, which is effectively unlimited. Kafka's tiered storage (KIP-405) is production-ready in recent versions; check its status and limitations for yours. With most retention in object storage, local disks hold hours instead of days, so a surge has far more headroom before it threatens a broker.

6After the Incident: Making It a Platform

Finally, the processes. New topics go through onboarding where the team declares expected throughput, message size, retention and criticality, which sets their quotas and broker group. Chargeback, billing each team for its usage, makes the cost of a runaway producer visible to the team that owns it. And a runbook for emergency quota changes, with the exact commands above and who may approve them, means the next on-call engineer can throttle a tenant in five minutes instead of an hour.

7Follow-up questions

Why throttle rather than reject the producer outright?

Throttling slows the client without errors, so most applications survive and their own buffers absorb the delay. For a clearly broken producer, setting the quota near zero effectively stops it; the owning team can then fix the bug without the platform having to break their service entirely.

Would more partitions or brokers have prevented this?

Only by delaying it. A surge of 30 times normal volume fills any fixed capacity eventually. Quotas and per-topic storage limits are what bound one tenant's impact.

How do you choose each tenant's quotas?

From the declared throughput at onboarding plus headroom, for example three times the normal rate, reviewed against actual usage every quarter, with a fast path to raise them for planned events.

8Conclusion

In this answer, we recovered a shared cluster in the right order: throttle the offending producer by client id, free space by shortening retention or truncating with the owner's agreement, clear space on the full brokers before restarting them, and watch under-replicated partitions catch up. We then isolated tenants with broker-enforced quotas on byte rates, request rates, partition counts and storage, alerts on projected time to full, separate broker groups or clusters for large and critical tenants, and tiered storage to lower local disk pressure, backed by onboarding, chargeback and an emergency quota runbook.

What to say in the interviewAbout 80 seconds aloud

Open with

To recover I would first stop the inflow: throttle or block the offending producer by client id with a broker quota, which takes effect without restarts. Then, with the owner's agreement, shorten that topic's retention or delete records up to an offset so the brokers free space.

Then, if they want more

I would not restart the two dead brokers until their disks have space, otherwise they fail again; after restarting, I would watch under-replicated partitions as they catch up and throttle replication if it hurts latency.

For isolation, I would enforce per-tenant quotas in the brokers: produce and fetch byte rates, request rates, partition counts through the provisioning policy, and storage caps per topic, such as retention.bytes.

Alerts should be on forecast, not just level: disk at 70 to 80 percent plus projected time to full, and per-topic growth against baseline, so a topic exceeding its storage quota is stopped before a shared disk fills.

Large or critical tenants should get separate broker groups or clusters so failure domains follow importance, and tiered storage moves old segments to object storage to lower local disk pressure. Afterwards, onboarding with declared throughput, chargeback by usage and a runbook for emergency quota changes.

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 "How do you recover the shared cluster, and what isolation would you build so one...": https://scrivio-interview-library.netlify.app/architecture/system-design-problems/4cc02028fd/