Cloud

Azure Event Hubs: validate a partition increase before changing a production stream

A production runbook for testing parallelism, event ordering, client behavior and recovery before increasing an Event Hub partition count.

24 Nov 2026 azureevent-hubsstreamingpartitionsconsumer-lagcheckpointobservabilityrunbookrollbackproduction

An order-processing pipeline is falling behind. The team proposes adding Event Hubs partitions so it can run more consumers. Events for each order use a partition key, however, and their order determines downstream database updates. After a partition increase, new events for a key can land on a different partition while older events are still being processed. More parallelism can therefore produce out-of-order business transitions.

This runbook applies to an existing event hub with known producers, consumer groups and downstream effects. It builds on the consumer lag diagnosis, but addresses a different decision: whether repartitioning is acceptable, how to prove it, and how to recover when the count cannot be rolled back.

Prove that partitions are the limiting factor

For each consumer group, compare ownership, lag, successful business progress and checkpoints by partition. Record active instances, processing errors and downstream latency. If all partitions are assigned to saturated consumers, more partitions may create useful parallelism, provided the downstream system can absorb it.

They will not fix a slow database, failed processing or a stalled checkpoint. A hot key can remain concentrated on one partition. Check namespace throttling and shared capacity too: increasing partition count does not itself add namespace capacity.

Record the following before proposing a change:

  • namespace, event hub, service tier, current count and target count;
  • producers, protocols and client versions, partition keys and any direct partition sends;
  • every consumer group, owner, checkpoint and downstream dependency;
  • per-partition lag and progress, remaining retention, errors, throughput and stop thresholds;
  • decision owner, change window and a tested recovery procedure.

Dynamic increases are available in Premium and Dedicated. Basic and Standard partition counts cannot be changed after creation. Even where an increase is supported, the count cannot be decreased. A second command is not a rollback.

Establish ordering and recovery contracts

For each producer, identify whether order matters per order, customer or other key, and whether downstream systems detect duplicates and out-of-order versions. Ordering within a partition is not a global ordering guarantee. A changed partition count can remap new events for a key while an earlier partition is still being processed.

When ordering matters and producers use partition keys, Microsoft advises against adding partitions dynamically. Hold the change until an ordering barrier has been demonstrated. One possible procedure is to pause all affected producers, confirm in-flight sends have finished, then let every critical consumer group process the old partitions to a recorded end boundary. Verify business effects and checkpoints, not reads alone. Resume producers only after the new assignments have been validated. The interruption must be acceptable and tested; otherwise use a migration designed to preserve order, or do not proceed.

Retention does not guarantee idempotency or reverse external effects. Document deduplication keys, processing boundaries and reconciliation before any replay.

Rehearse with representative clients

Reproduce the service tier, client versions and production send and receive patterns. Publish numbered sequences for several keys, including a hot key, and compare sent events, received events and business effects. Include an unkeyed producer if production uses one.

Exercise the actual client types separately:

  • direct readers tied to partition IDs must discover and take ownership of new partitions;
  • for an Event Hubs processor, test metadata refresh, ownership and existing checkpoints with the exact client version, including a coordinated instance restart if needed;
  • for Kafka, observe metadata refresh, rebalance, assignments and offsets for each group. Test producer behavior through the transition too.

Reject the change if any new partition is unowned, events are missing, effects are duplicated or out of order, or recovery violates the business contract. Set a service-specific observation period, numeric thresholds and an owner for each check. A successful test of one consumer group is not enough.

Execute and observe

In the approved window, capture the event hub configuration, client settings, positions and metrics as a baseline. Apply the agreed ordering barrier, then make the change through the approved infrastructure process. Do not edit offsets or checkpoints merely to make progress appear healthy.

After propagation, compare the effective partition list with assignments in every group. Monitor receipt, successful processing, checkpoint age and errors per partition, alongside rebalance errors, downstream saturation and latency. Verify end-to-end business sequences, including keys active on both sides of the change. Healthy aggregate throughput does not prove a new partition is being consumed.

Decide and contain

Continue only when every partition is covered, business sequences and effects are correct, and lag converges without overwhelming downstream systems. Hold producer resumption or affected traffic if ownership, ordering or reconciliation is uncertain.

The old partition count cannot be restored on the same event hub. Prepare recovery before the change: route producers to a preconfigured replacement event hub with the former count only after defining the boundary between streams, each group’s starting positions, access, consumers and deduplication. Changing an endpoint does not move events or checkpoints and does not automatically preserve order. Reconcile both streams before resuming. If that procedure has not been rehearsed, keep the affected flow stopped and manage the incident within the retention window.

References: dynamically add partitions and Event Hubs capacity and isolation.