Document Valkey AOF and Recreate strategy to prevent session loss

What does this MR do?

The Valkey install command in the bundled chart migration guide relies on periodic RDB snapshots only (save 3600 1 300 100 60 10000, AOF off). A graceful drain is fine because Valkey saves a final snapshot on SIGTERM. When the node that runs Valkey is lost without a graceful shutdown, every change after the last snapshot is lost, which signs out all users (see #6732 (closed)).

The chart also defaults to deploymentStrategy: RollingUpdate. With a ReadWriteOnce volume, the new Pod starts before the old one stops, so two Valkey processes can share one data directory when both land on the same node.

This MR:

  • Adds valkeyConfig="appendonly yes" and deploymentStrategy=Recreate to the documented install command, and pins the commands to Valkey chart 0.12.1. The unreleased 1.0 chart renames dataStorage.* and valkeyConfig and refuses the old keys. It also makes Recreate the default, see valkey-io/valkey-helm#272.
  • Documents how to turn on AOF for an existing instance, following the upstream Valkey procedure: optionally back up dump.rdb, run CONFIG SET appendonly yes on the live instance, wait for the AOF rewrite, then persist the setting through Helm.
    • Adding appendonly yes to an existing release starts Valkey with an empty dataset and ignores dump.rdb.
    • Helm 4 (server-side apply) cannot switch an existing Deployment from RollingUpdate to Recreate (spec.strategy.rollingUpdate: Forbidden), so the procedure patches the strategy first.
  • Applies both settings to the CI Valkey deployment in scripts/ci/lib/valkey.sh. CI review environments use one release per pipeline, so they always install fresh.

Note for local development: with an existing dev environment, run helm uninstall dev-valkey -n gitlab before re-running scripts/dev_dependencies.sh setup.

Validation

Tested on a 3-node kind cluster with Valkey chart 0.12.1 (Valkey 9.1.3). For the drain and node-loss tests, the PV was shared between workers to mimic movable block storage.

Scenario Result
Previous docs config, graceful kubectl drain Data kept (final RDB save on SIGTERM)
Previous docs config, node hard-killed Writes after the last snapshot lost
Naive helm upgrade adding appendonly yes All data lost on restart
Documented fresh install, valkey-server SIGKILLed Data replayed from AOF
Documented existing-instance procedure, run as written All keys kept, AOF on, Recreate, survives SIGKILL
deploy_external_valkey, fresh and upgraded from previous script Recreate, appendonly yes

valkey-benchmark (SET/INCR/LPUSH, 200k ops, 256 B values) showed throughput within about 3% with AOF on (appendfsync everysec), with p50 latency about 0.02 ms higher.

Closes Gitlab forgets login if underlying node goes away (#6732 - closed)

Author checklist

For general guidance, please follow our Contributing guide.

Required

For anything in this list which will not be completed, please provide a reason in the MR discussion.

  • Merge Request Title and Description are up to date, accurate, and descriptive.
  • MR targeting the appropriate branch.
  • MR has a green pipeline.
  • Documentation created/updated.
  • Tests added/updated. (Not applicable: documentation and CI script change only.)
  • Have you validated that your change works end-to-end on a real cluster deployment?
    • See Validation above.
  • Equivalent MR/issue for omnibus-gitlab opened. (Not applicable.)
  • When ready for review, MR is marked as ready (not a draft) and assigned to a reviewer.

Reviewers checklist

🤖 Generated with Claude Code

Edited by Clemens Beck

Merge request reports

Loading
Loading