Skip to content

Fix redpanda default log_retention_ms=-1 using init loop - #88

Closed
solsson wants to merge 1 commit into
mainfrom
redpanda-retention-fix
Closed

solsson wants to merge 1 commit into
mainfrom
redpanda-retention-fix

Conversation

@solsson

@solsson solsson commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

0fbe8e6 probably didn't work

I tentatively prefer #89 instead.

bootstrap.yaml's log_retention_ms: -1 (0fbe8e6) does not survive a restart on redpanda v24.2.
At first start the bootstrap import serializes the cluster property through an unsigned 64 bit
integer, so the controller log and config_cache.yaml get 18446744073709551615. Redpanda then
rejects that value: `rpk cluster config status` lists log_retention_ms as INVALID, and at every
restart the broker logs "Ignoring invalid property: log_retention_ms=18446744073709551615" and
uses the 7 day default. Any negative value takes the same path, and a null is dropped by helm.
So a cluster keeps records only until its first restart.

The value is now set where it works, through the admin API: the chart's postStart.sh runs
`rpk cluster config set log_retention_ms=-1` while the cluster has the 7 day default
(604800000), and leaves any other value as it is. It runs before the chart's own hook, which
never completes on this image: /bin/sh is dash, which has no `source`.

Verified on a throwaway cluster with ghcr.io/yolean/redpanda:v24.2.14: a fresh start, a restart,
an upgrade from a cluster bootstrapped with -1, and a cluster with log_retention_ms=86400000,
which keeps its value. After the hook, `rpk cluster config get log_retention_ms` prints
-9223372036854775808, status lists nothing INVALID, and a topic without its own retention shows
retention.ms -1 DEFAULT_CONFIG. Applying this rolls no broker: it takes effect at the next
broker start. To set it on a running cluster now:

  kubectl -n kafka exec redpanda-0 -c redpanda -- rpk cluster config set log_retention_ms=-1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@solsson solsson changed the title Fix redpanda default log_retention_ms=-1 Fix redpanda default log_retention_ms=-1 using init loop Oct 20, 2026
@solsson solsson closed this Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant