log.local.retention.ms — Kafka Broker Configuration
The number of milliseconds to keep the local log segments before it gets eligible for deletion. Default value is -2, it represents log.retention.ms value is to be used
Description
The number of milliseconds to keep the local log segments before it gets eligible for deletion. Default value is -2, it represents log.retention.ms value is to be used. The effective value should always be less than or equal to log.retention.ms value.
Default Values by Kafka Version
| Component | Kafka version line | Documented default |
|---|---|---|
| Broker | 3.6 | -2 |
| Broker | 3.7 | -2 |
| Broker | 3.8 | -2 |
| Broker | 3.9 | -2 |
| Broker | 4.0 | -2 |
| Broker | 4.1 | -2 |
| Broker | 4.2 | -2 |
| Broker | 4.3 | -2 |
| Broker | 4.4 | -2 |
Tuning Recommendation
Workload-dependent proposals, not benchmarked defaults. Review the versioned Config Advisor before applying.
| Profile | Proposal | Rationale and tradeoff |
|---|---|---|
| broker / cost | 86400000 | Sets local time retention for tiered topics. -2 inherits total time retention; the effective local value must be no greater than total retention. Tradeoff: Local eviction increases the chance of a remote fetch. It does not replace total retention or automatically enable tiering. Manual decision; not an executable preset. Reference · 2026-10-27 |
Related Configs
remote.log.storage.system.enable · log.retention.ms · log.local.retention.bytes