Principle:Apache Kafka Coordinator Timer Scheduling
| Knowledge Sources | |
|---|---|
| Domains | Distributed_Systems, Scheduling |
| Last Updated | 2026-02-09 12:00 GMT |
Overview
A deferred execution mechanism that schedules time-based operations within the coordinator runtime.
Description
Coordinator Timer Scheduling provides a way to execute operations after a specified delay. Timers are used for session timeouts, heartbeat deadlines, delayed rebalances, and other time-dependent coordinator behaviors. Each timer is identified by a unique key and can be cancelled or overridden. When a timer fires, it generates a write operation that produces records, maintaining the coordinator's log-based state management model.
Usage
Use this principle for any coordinator behavior that requires delayed execution, such as consumer group session timeouts or delayed partition reassignments.
Theoretical Basis
- Key-Based Management: Each timer has a unique key for cancellation and override.
- Write Operation Integration: Timer expiration triggers a write operation that generates records, keeping all state changes in the log.
- Retry Support: Failed timer operations can be automatically retried with configurable backoff.
- Leadership Awareness: Timer operations that fail due to NotCoordinatorException are silently ignored since the coordinator is no longer active.