Skip to content

Stop forcing appendonly yes on persistent clusters - #78

Merged
albertompe merged 2 commits into
mainfrom
bugfix/GH-77-no-implicit-aof-persistent
Oct 26, 2026
Merged

albertompe merged 2 commits into
mainfrom
bugfix/GH-77-no-implicit-aof-persistent

Conversation

@albertompe

@albertompe albertompe commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #77.

Robin no longer forces appendonly yes on persistent (ephemeral: false) clusters. Each persistence directive is now written by exactly one layer:

Mode appendonly / save written by If not set
ephemeral: true Robin (appendonly no + save ""), unchanged —
ephemeral: false The user, via spec.config Redis defaults: AOF off, RDB save 3600 1 300 100 60 10000

The AOF/RDB decision for persistent clusters goes back to the user. The generated redis.conf also stops repeating directives that clients such as the Helm chart already set explicitly.

Changes

  • internal/kubernetes/objects.go: buildRedisConf drops the else { appendonly yes } branch and documents the ownership.
  • internal/kubernetes/objects_test.go:
    • New table-driven TestBuildRedisConf_PersistenceOwnership over {ephemeral, persistent} × {cluster, standalone} × {no user persistence, user enables, user disables}. It counts directive lines:
      • ephemeral: Robin's appendonly no / save "" appear exactly once, before the user config;
      • persistent: Robin adds none.
    • TestBuildConfigMap_Ephemeral / TestBuildConfigMap_NonEphemeral updated.
  • CHANGELOG.md: breaking-change entry with migration notes.

Breaking change

Persistent clusters that do not set appendonly in spec.config will no longer have AOF enabled. They fall back to the Redis defaults: RDB snapshots with the default save points, AOF off.

  • Upgrading Robin does not change already deployed clusters. The ConfigMap is only regenerated when:
    • the Redkey changes (config, image, resources, labels, etc.), which goes through the upgrade flow and recycles the pods;
    • the cluster scales up from zero;
    • the password is rotated.
  • Cluster mode: the upgrade migrates the slots before recycling each node, so no data is lost.
  • Standalone mode: the restarted pod reloads the dump.rdb written at shutdown. If spec.config sets save "", it starts empty.
  • Password rotation: the ConfigMap is rewritten without recycling the pods, so the change applies on the next pod restart. After a crash, writes since the last RDB snapshot are lost.
  • Migration: add appendonly yes (and save ... if needed) to spec.config of persistent clusters to keep AOF.
  • Not affected: deployments using the Helm chart, because the chart already renders explicit save / appendonly.

Additional context

  • go test ./internal/...: 617 passed. make test-integration: 58/58. make lint: 0 issues.
  • Validated end-to-end together with redkey-operator#113: the new E2E spec persistence passed 5/5 on kind with this Robin build.
  • Redis 8.10 behaviour checked in Docker: without a save line RDB stays on with the default save points; without an appendonly line AOF stays off.
  • Operator docs and E2E alignment: redkey-operator#113.

Signed-off-by: Alberto Martínez Pérez <albertompe@ext.inditex.com>
@albertompe
albertompe requested a review from a team as a code owner October 23, 2026 10:41
…hange

Signed-off-by: Alberto Martínez Pérez <albertompe@ext.inditex.com>
@albertompe
albertompe merged commit 783c700 into main Oct 26, 2026
18 checks passed
@albertompe
albertompe deleted the bugfix/GH-77-no-implicit-aof-persistent branch October 26, 2026 08:59
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.

[Bug] Stop forcing appendonly yes on persistent clusters: leave AOF/RDB to spec.config

3 participants