Steadybit logoReliability Hub
GitHubGitHub iconStart Free Trial
Steadybit logoReliability Hub

Trigger Partition Leader Election

AttackAttack
Trigger a partition leader election by reordering replicas so the next in-sync replica becomes the preferred leader
Targets:
Kafka Topics
Install now

Trigger Partition Leader Election

Trigger a partition leader election by reordering replicas so the next in-sync replica becomes the preferred leader
AttackAttack
Install now

Trigger Partition Leader Election

AttackAttack
Trigger a partition leader election by reordering replicas so the next in-sync replica becomes the preferred leader
Install now

Trigger Partition Leader Election

Trigger a partition leader election by reordering replicas so the next in-sync replica becomes the preferred leader
AttackAttack
Install now
Go back to list
The action "Trigger Partition Leader Election" within the experiment editor.The action "Trigger Partition Leader Election" within the experiment editor.

Introduction

Triggers a partition leader election for a given topic by electing the preferred replica. To force the election, the action reorders the replica assignment so that the next in-sync replica becomes the first (preferred) replica and the current leader is moved to last position.

Warning: This action modifies the replica assignment order to force the election. The replica order change persists after the action completes — it is not automatically rolled back.

Use Cases

  • Trigger a leader election to test how producers and consumers handle the brief unavailability during leader transitions.
  • Force an election before the automatic imbalance threshold kicks in, to test the election path in a controlled manner.
  • Combine with Check Partitions (using expectedChanges: leader changed) to verify the election was observed.

Parameters

ParameterDescriptionDefault
Partition to elect new leaderOne or more partition IDs to trigger a leader election on. Specified as a list of partition numbers (e.g., 0, 1). Each selected partition will have its replica order changed to force a new preferred leader election.

Useful Templates

See all
Validate consumer's behavior when new leader is elected

Verify that your application handles a change of the leader properly.

Motivation

By testing your system's resilience to Kafka leader changes in a partition, you can identify potential weaknesses and take appropriate measures to improve its performance.

Structure

To conduct this experiment, we will ensure that all Kafka topics and producers are ready and that the consumer receives and processes messages correctly. We will then elect a new leader for one partition in Kafka and expect the system to work fine.

Message Queue
Kafka
Recoverability

More Kafka Topic Actions

See all
Start Using Steadybit Today

Get started with Steadybit, and you’ll get access to all of our features to discover the full power of Steadybit. Available for SaaS and on-prem!

Are you unsure where to begin?

No worries, our reliability experts are here to help: book a demo with them!

Statistics
-Stars
Tags
Message Queue
Kafka
AWS
Homepage
hub.steadybit.com/extension/com.steadybit.extension_kafka
License
MIT
MaintainerSteadybit
Install now
Steadybit logoReliability Hub
Start Free Trial
© 2026 Steadybit GmbH. All rights reserved.
Twitter iconLinkedIn iconGitHub icon