Skip to content

Fix: persist Redis so a setup-vm.sh re-run keeps every session - #607

Merged
cwiklik merged 2 commits into
rossoctl:mainfrom
cwiklik:fix/410-redis-persistence
Oct 26, 2026
Merged

cwiklik merged 2 commits into
rossoctl:mainfrom
cwiklik:fix/410-redis-persistence

Conversation

@cwiklik

@cwiklik cwiklik commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Summary

start_redis ran podman run --replace unconditionally, with no named volume. Redis holds the control plane's session and ownership index, the harness session state (@moca/session-backend), the lease store and sh:sandbox:records — so every re-run silently forgot every user's sessions. A re-run is also the documented way to apply a changed control-plane.env (deploy/vm/README.md, deploy/microvm/P4-ON-P6.md), which made the installer's own procedure destructive. Seen twice in one run during the P6.3 acceptance (#425).

Two changes, both of which the issue asks for:

  1. Persistence. Redis now runs on a named volume (MOCA_REDIS_VOLUME, default moca-redis) with --appendonly yes — matching what the Kubernetes path already did (PVC in deploy/k8s/base/redis.yaml, appendonly yes in deploy/k8s/setup.sh). The volume alone would not be enough: without AOF, Redis snapshots only on its save points, so a reboot still drops the last window's writes out of a volume that was kept.

  2. A re-run is non-destructive. redis_container_diff inspects the image, published port, /data volume and appendonly setting; an identical container is left alone, and when one does get replaced the log names the field that differed — otherwise an operator sees their Redis recreated with no way to tell why. This matches the contract the rest of the installer already keeps (install_env_file never clobbers an operator-edited env file).

This closes the gap docs/reference/maturity-and-lifecycle.md names as a Single-VM promotion blocker.

Two corrections to the issue's own premises, both verified by live podman probe (6.1.1, arm64)

1. The data was orphaned, not destroyed. As @pdettori noted, redis:7-alpine declares VOLUME /data, so each --replace got a new anonymous volume and orphaned the last — the rig accumulated 11. Those sessions are recoverable, which is what makes an opt-in adoption path worth building: SH_REDIS_ADOPT_VOLUME=1 migrates them. It is off by default — the installer warns about the old volume, naming it and the flag, rather than rewriting live data unasked.

2. ⚠️ The recovery recipe in that comment becomes wrong the moment AOF is on. With --appendonly yes, Redis 7 ignores an existing dump.rdb and loads the empty AOF instead. I probed both paths:

Path Result
copy dump.rdb into a fresh volume, start with --appendonly yes DBSIZE=0, GET=[] — silently empty
start without appendonly (RDB loads) → CONFIG SET appendonly yes DBSIZE=1, GET=[old-session], aof_enabled=1

So "copy dump.rdb in, start Redis" yields an empty Redis after this change, and a naive --appendonly yes over the rig's live volume would discard the very sessions we are saving. The second order is what adopt_redis_volume implements, what the tests pin, and what the README now documents — with an explicit "do not just copy a dump.rdb in" warning, or the next operator follows a documented procedure into an empty Redis.

A detection detail worth recording: the anonymous volume is identified via podman volume inspect --format '{{.Anonymous}}', not from the mount. podman reports an anonymous volume's .Name as a 64-hex id — indistinguishable from a name an operator chose. My first cut assumed an empty .Name, which would have made the adoption path unreachable on every real host. The new tests catch that: reverting the .Anonymous read reproduces exactly that bug and the suite fails.

Compose

deploy/compose/docker-compose.yml justified having no volume as "No volume, same as the VM path" — a premise this change removes, so it gets the same named volume and appendonly. Separable: say the word and I'll drop this half if you'd rather compose stay throwaway.

Tests

Six new cases in deploy/vm/tests/setup-vm.test.sh, in the file's existing style (mock argv asserted out of $MOCK_LOG):

  • a second run over an already-matching sh-redis issues no run/rm/stop — the issue's own acceptance item;
  • each of five differences (image, port, a different named volume, no /data mount, missing appendonly) replaces it and says which field differed;
  • the run carries both -v moca-redis:/data and --appendonly yes;
  • an anonymous-volume container with no flag warns — naming the volume, the flag, and that the data is not deleted — and nothing touches the data;
  • with SH_REDIS_ADOPT_VOLUME=1, the recorded order is SAVE → stop → copy → appendonly-off conversion → CONFIG SET appendonly yes → final run. The order is the part that was wrong in the issue's recipe, so it is what the test pins;
  • adoption ignores a container that already has a named volume.

Honest limitation: the suite mocks podman entirely, so it pins the shape and order of the adoption, not Redis's own loading behaviour. That is established by the live probes above — including the full end-to-end adoption against a seeded pre-#410 container (no -v, no appendonly), which read back GET=[old-session] with aof_enabled=1. Both probes cleaned up fully.

Verification

Gate Result
bash deploy/vm/tests/setup-vm.test.sh ✅ EXIT 0
bash deploy/compose/tests/compose.test.sh ✅ EXIT 0
shellcheck -S warning (the 4 touched scripts) ✅ EXIT 0
prettier --check (the 6 touched docs/YAML) ✅ EXIT 0
make test-deploy EXIT 2 — see below
Live podman probe, end state + adoption + the trap ✅

make test-deploy fails 2 assertions in deploy/microvm/tests/build-snapshot.test.sh (the snapshot-publish scenarios). Both are pre-existing and unrelated: identical failures on a stashed clean tree, in a file this PR does not touch, and CI is green on 691c866d — my exact base. They look like a macOS-host artifact of that harness's non-root install/permission shimming.

No .go, .proto or TypeScript touched, so the buf/gofmt/pnpm gates are unaffected. No rig needed — the single-VM path's tests are cluster-free and root-free by design.

Out of scope

Backup and upgrade guides — the other half of the Single-VM promotion gap in maturity-and-lifecycle.md. Worth its own issue.

Closes #410


Assisted-By: Claude Code

@cwiklik
cwiklik requested a review from pdettori as a code owner October 23, 2026 21:58
@pdettori pdettori added the ready-for-ai-review Request automated AI code review from clawgenti label Oct 23, 2026

@ingpaolodettori-dev ingpaolodettori-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

The persistence half is right: a named volume plus AOF, a non-destructive re-run when the container already matches, and a Compose path that matches the k8s and VM paths. The adoption design (SAVE, then an appendonly-off conversion, then CONFIG SET appendonly yes) is also well reasoned. One blocking problem: the migration path the PR advertises can't be reached the way the warning and the docs tell operators to use it. The default run already replaces the pre-#410 container with one on moca-redis, so a follow-up SH_REDIS_ADOPT_VOLUME=1 run finds a matching container and does nothing. The adoption sequence also has two failure-path gaps (details inline).

Author: cwiklik (MEMBER — maintainer)
Areas reviewed: Shell (setup-vm.sh, its test, compose test, smoke.sh), YAML (docker-compose.yml), Docs (vm README, P4-ON-P6.md, demo, maturity table)
Agent/IDE config (.claude/.vscode): none
Commits: 1 commit, all signed-off: yes
CI status: passing (all 14 checks green, including shellcheck and deploy-scripts)

Must-fix

  1. adopt_redis_volume is unreachable after the default run (setup-vm.sh:291, P4-ON-P6.md:630, README.md:672). On a pre-#410 host, the first re-run without the flag warns and then start_redis runs podman run --replace … -v moca-redis:/data. From then on, redis_container_diff returns matches, so sudo env SH_REDIS_ADOPT_VOLUME=1 ./deploy/vm/setup-vm.sh (exactly what the warning prints) keeps the running container and never migrates. The old sessions are left on an orphaned anonymous volume, and the only remaining route is the by-hand recipe. Even if adoption could run at that point, it would copy over a moca-redis that already holds sessions created since the first run. Possible fixes:

    • (a) On the default path, leave the anonymous-volume container running and stop with the warning until the operator picks SH_REDIS_ADOPT_VOLUME=1, or an explicit opt-out such as =0 that starts fresh.
    • (b) Let the flag name an orphaned volume to adopt from (SH_REDIS_ADOPT_VOLUME=<volume>), and refuse it when moca-redis is non-empty.

    Either way, add a test case for the warn-then-re-run-with-flag sequence: that's the path operators will actually take, and today's tests only cover the flag on the first run.

Non-blocking: the adoption path has no failure handling (stopped sh-redis, a leftover sh-redis-adopt, and a re-run that then dies at SAVE). The AOF-rewrite wait goes on to SHUTDOWN NOSAVE even after it times out. And the *appendonly* glob also matches --appendonly no.

Comment thread deploy/vm/setup-vm.sh Outdated
"host installed before #410 does). This run starts Redis on the named volume" \
"'$MOCA_REDIS_VOLUME' instead, so those sessions become unreachable -- they are NOT" \
"deleted, and podman keeps the old volume until you remove it. To migrate them into the" \
"named volume, re-run with: sudo env SH_REDIS_ADOPT_VOLUME=1 $0" >&2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must-fix: this advice can't work after this run. When adopt_redis_volume returns, start_redis replaces sh-redis with the moca-redis container (L378). The next run's redis_container_diff then reports matches (image, port, volume and --appendonly all line up), so start_redis returns at L374 before adopt_redis_volume is ever called, and the SH_REDIS_ADOPT_VOLUME=1 re-run printed here is a no-op. The anonymous volume stays orphaned. Also, by then moca-redis already holds the sessions created since this run, so adopting into it afterwards would overwrite them anyway. Suggest either not replacing the container on this path (keep the old one running and exit non-zero with this warning until the operator chooses =1 or an explicit =0/fresh start), or letting the flag name an orphaned volume and refusing a non-empty moca-redis. Please also add a test for the warn → re-run-with-flag sequence.

Comment thread deploy/microvm/P4-ON-P6.md Outdated
leaves that volume in place and starts the named one empty, so the control plane's session and
ownership index reads as gone (the workspaces stay under `/srv/workspaces` until idle reclaim,
orphaned). Nothing is deleted — re-run once with
`sudo env SH_REDIS_ADOPT_VOLUME=1 ./deploy/vm/setup-vm.sh` to migrate it. Do that before a demo,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must-fix (same root cause as setup-vm.sh:291): after "the first re-run warns … starts the named one empty", sh-redis is already on moca-redis and matches, so re-running "once with SH_REDIS_ADOPT_VOLUME=1" doesn't migrate anything. Whatever the fix in setup-vm.sh turns out to be, this sentence (and README.md:672) should describe the order that actually works, which today is: pass the flag on the first post-#410 run.

Comment thread deploy/vm/README.md Outdated
previous one: those sessions were unreachable but never deleted, and a long-lived rig can hold a
stack of them (`podman volume ls`).

On such a host the first re-run warns that it is leaving that volume behind and starts the named one

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must-fix (same as setup-vm.sh:291): "the first re-run warns … To migrate the sessions in it instead, re-run once with" reads as "run it plainly, then run it again with the flag", and that second run is a no-op once the first has replaced sh-redis. If the flag has to be on the first run, say so explicitly, and say what to do if that run has already happened (the by-hand recipe below, aimed at the right orphan).

Comment thread deploy/vm/setup-vm.sh Outdated
# SAVE first, synchronously: the dump.rdb on disk is otherwise as old as the last save point, so
# copying without this silently drops the most recent sessions -- the ones most likely to matter.
podman exec sh-redis redis-cli SAVE
podman stop sh-redis

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: from this point on, nothing undoes a failure. If anything later fails under set -e, say the cp (no dump.rdb, e.g. a host whose Redis never hit a save point), the PING loop running out, or CONFIG SET, the script exits with sh-redis stopped, and possibly with sh-redis-adopt still running on moca-redis. The re-run that the error invites then fails at L297, because podman exec on a stopped container errors, and the flag wedges the installer. Consider a trap or explicit error path that removes sh-redis-adopt and podman starts sh-redis again, and/or podman start sh-redis before the SAVE when it isn't running.

Comment thread deploy/vm/setup-vm.sh
for ((i = 0; i < 60; i++)); do
[[ "$(podman exec sh-redis-adopt redis-cli INFO persistence 2>/dev/null |
sed -n 's/^aof_rewrite_in_progress:\([0-9]*\).*/\1/p')" == 0 ]] && break
sleep 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: if this loop runs out its 60 s with the rewrite still in progress (a large dataset, or slow disk), execution falls through to SHUTDOWN NOSAVE. That's exactly the partial-AOF/silently-empty outcome the comment above warns about, and the next log line says "adopted". Please check aof_rewrite_in_progress:0 and aof_last_bgrewrite_status:ok after the loop, and fail (leaving the old volume untouched) when either doesn't hold.

Comment thread deploy/vm/setup-vm.sh Outdated
out+=("/data volume is '$volume', expected $MOCA_REDIS_VOLUME")
fi
fi
[[ "$appendonly" == *appendonly* ]] || out+=("it runs without --appendonly yes")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: *appendonly* also matches a container created with redis-server --appendonly no, which would then read as matching and never be fixed. *'--appendonly yes'* matches only what L380 actually creates.

@cwiklik

cwiklik commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Thanks — the must-fix was real, and worse than a doc problem: the warning made its own advice unreachable, so there was no sequence of runs that ever migrated anything. Fixed in fb723a2.

Per item

# Comment What changed
1 setup-vm.sh:291 must-fix Took your option (a): with no flag the installer now refuses (return 1) and changes nothing, naming both routes. start_redis propagates it (adopt_redis_volume "$diff" || return 1), so the run aborts under set -e instead of replacing the container. I also took (b)'s guard: redis_adopt_target_nonempty refuses to adopt into a non-empty moca-redis, which is the overwrite case you flagged. Test added for the refuse → re-run-with-flag sequence.
2 P4-ON-P6.md:630 must-fix Now: "On a host installed before #410, the next setup-vm.sh run STOPS until you choose", both flags shown, plus "get this out of the way before a demo, not mid-demo".
3 README.md:672 must-fix Rewrote the section so it reads as one choice, not run-then-rerun, with both commands and a "The choice is offered once" paragraph pointing at the by-hand recipe for hosts where it already happened.
4 setup-vm.sh:298 suggestion redis_adopt_rollback(): remove sh-redis-adopt, volume rm --force the half-written volume, podman start sh-redis. And podman start sh-redis before the SAVE — podman exec on a stopped container was exactly what wedged the re-run. Every step in redis_adopt_migrate checks with || return 1, because set -e doesn't apply inside a function used as an if condition.
5 setup-vm.sh:321 suggestion Timeout is now a failure, not a fall-through: checks aof_rewrite_in_progress:0 and aof_last_bgrewrite_status:ok, rolls back, leaves the old volume untouched.
6 setup-vm.sh:259 nit *"--appendonly yes"*. You were right that the loose glob would have kept --appendonly no forever — and it had no test, which a mutation run proved. Added one.

Evidence

Each of the four fixes was mutation-tested — reverting any one of them fails the suite (restoring warn+continue fails with the exact "advice unreachable" case; dropping the timeout check, the rollback, or the glob each fail too).

The mocks only pin shape and order, so I also probed real podman with a seeded pre-#410 sh-redis (no -v, no appendonly → anonymous volume, Anonymous=true), holding a key:

  • no flag → exit 1, both routes named, sh-redis still running on the anonymous volume, key readable, no moca-redis created;
  • =1 with a forced mid-migration failure (a decoy container occupying sh-redis-adopt) → exit 1, host restored to exactly that state, both artifacts removed;
  • =1 → key migrated, aof_enabled=1;
  • re-run → "keeping the running sh-redis", no podman run;
  • podman restart → key survives.

One note: the rewrite-timeout case spun the real 60s loop and took the suite from 17.5s to 78s, so the two retry caps are env knobs (SH_REDIS_ADOPT_PING_TRIES, SH_REDIS_ADOPT_REWRITE_TRIES) with the real values as defaults. A rewrite that never finishes has to reach the end of the loop to be a failure, so the test can't just shorten the sleep.

make test-deploy locally reports the 2 pre-existing deploy/microvm/tests/build-snapshot.test.sh failures, which are a macOS-host artifact — microvm-gates passed on this code in CI.

Assisted-By: Claude

@cwiklik

cwiklik commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Heads-up on the red deploy-scripts: it is not this PR. It fails in deploy/microvm/tests/systemd-units.test.sh, which this branch does not touch (the diff is 4 files, all under deploy/vm and deploy/microvm/P4-ON-P6.md). My new tests pass in that same job — all setup-vm.sh tests passed.

The cause is the ubuntu-latest runner moving to Ubuntu 26, which the job annotates itself. systemd 258 removed CPUAccounting=, so systemd-analyze verify now warns about the runner image's own units (walinuxagent, xfs_scrub_all, system-xfs_scrub), and the assertion required every diagnostic but one to be empty.

Evidence it is time, not this diff: 51fb0549 passed this job on 10-23 and fb723a2a fails on 10-26. It will be red on every PR in the repo, including #605.

Split the fix out as #608, since it is deploy/microvm CI infra unrelated to this change. Once that merges I will rebase this branch and deploy-scripts should go green. Everything else here is passing (13/14).

Assisted-By: Claude

start_redis ran `podman run --replace` unconditionally, with no named volume.
Redis holds the control plane's session and ownership index, the harness session
state, the lease store and sh:sandbox:records -- so every re-run silently forgot
every user's sessions. A re-run is also the documented way to apply a changed
control-plane.env, which made the installer's own procedure destructive. Seen
twice in one run during the P6.3 acceptance (rossoctl#425).

Redis now runs on a named volume (MOCA_REDIS_VOLUME, default moca-redis) with
`--appendonly yes`, matching what the Kubernetes path already did (PVC in
deploy/k8s/base/redis.yaml plus appendonly in deploy/k8s/setup.sh). And a re-run
no longer replaces a container that already matches: redis_container_diff
inspects the image, published port, /data volume and appendonly setting, leaves
an identical container alone, and names the differing field when it does replace
one -- otherwise an operator sees their Redis recreated with no way to tell why.

Two corrections to the issue's own premises, both from live podman probes:

1. redis:7-alpine declares VOLUME /data, so the old form orphaned data on a
   fresh anonymous volume rather than destroying it -- the rig accumulated 11.
   Those sessions are recoverable, so SH_REDIS_ADOPT_VOLUME=1 migrates them.
   Off by default: the installer warns about the old volume rather than
   rewriting live data unasked.

2. The recovery recipe on rossoctl#410 ("copy dump.rdb in, start Redis") yields an EMPTY
   Redis once AOF is on, because Redis 7 loads the AOF and ignores an existing
   dump.rdb -- probed to DBSIZE=0. The order that works, and the order the
   adoption path implements and the tests pin: start with appendonly OFF so the
   RDB loads, CONFIG SET appendonly yes, then `--appendonly yes` thereafter.
   This had to land in the README too, or the next operator follows a documented
   procedure into an empty Redis.

The anonymous volume is detected via `volume inspect --format {{.Anonymous}}`,
not from the mount: podman reports an anonymous volume's .Name as a 64-hex id,
indistinguishable from a name an operator chose. Reverting that read makes the
adoption path unreachable on every real host, which the new tests catch.

Compose gets the same volume and appendonly, since its "no volume, same as the
VM path" justification no longer holds.

Closes rossoctl#410

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: cwiklik <[email protected]>
The first cut warned and carried on. That made its own advice unreachable:
the warning run replaced sh-redis with the moca-redis container, so every
later run's redis_container_diff said `matches`, start_redis returned early,
and the SH_REDIS_ADOPT_VOLUME=1 re-run the warning printed migrated nothing.

With no flag the installer now STOPS and changes nothing, naming both routes
(=1 migrate, =0 start fresh). start_redis propagates the refusal, so the run
aborts under set -e rather than replacing the container out from under it.

Also from review:

- refuse to adopt into a non-empty MOCA_REDIS_VOLUME, which would otherwise
  overwrite sessions created since the first post-rossoctl#410 run;
- roll back a failed migration (remove sh-redis-adopt, drop the half-written
  volume, restart sh-redis), so the re-run the error invites can succeed --
  and `podman start sh-redis` before SAVE, since `podman exec` on a stopped
  container was what wedged it;
- treat an AOF-rewrite timeout as a FAILURE instead of falling through to
  SHUTDOWN NOSAVE and logging "adopted" over a partial AOF; check both
  aof_rewrite_in_progress and aof_last_bgrewrite_status;
- match `--appendonly yes` exactly, not a bare *appendonly* glob that also
  matched `--appendonly no` and would have kept persistence off forever.

Verified against real podman on a seeded pre-rossoctl#410 container: the refusal
leaves it running on its anonymous volume with the key readable and no
moca-redis created; a forced mid-migration failure restores that same state;
adoption migrates the key with aof_enabled=1; the next run is a no-op; and
the key survives a restart. Each of the four fixes was mutation-tested --
reverting any one of them fails the suite.

The rewrite-timeout case spun the real 60s loop, so the two retry caps are
env knobs (defaults unchanged); the suite is back to 17.5s from 78s.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: cwiklik <[email protected]>
@cwiklik
cwiklik force-pushed the fix/410-redis-persistence branch from fb723a2 to 619c591 Compare October 26, 2026 14:46
@cwiklik

cwiklik commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

@ingpaolodettori-dev ready for re-review when you have a moment.

All 6 review comments are addressed in 619c591e (see my earlier response comment above for the detail on each). Since that comment, the only change is a rebase onto current main — no content change to the fix.

CI is now 14/14 green. The earlier deploy-scripts failure was never related to this PR: it was the repo-wide Ubuntu 26 runner regression in deploy/microvm/tests/systemd-units.test.sh, fixed separately in #608. The re-runs kept replaying the original merge commit (built against pre-#608 main), so they could never pick the fix up; rebasing produced a fresh merge commit and deploy-scripts passes in 3m18s.

mergeStateStatus is still BLOCKED solely on the CHANGES_REQUESTED review — a dismissal or re-approval is the last thing needed.

@ingpaolodettori-dev ingpaolodettori-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up on 619c591 (rebase of 51fb054+fb723a2 onto main d8bc58b).

git range-diff shows both commits =, and the PR's own files are byte-identical to fb723a2. The only blocker from the last round was the red deploy-scripts, and that was the Ubuntu 26 systemd-analyze breakage fixed by #608, as you said. It is green on this head.

All 6 items from the 51fb054 review were verified fixed at fb723a2: refuse-without-flag with the =1 re-run that actually migrates (docs aligned), =0 opt-out, checked steps with rollback that restarts sh-redis, AOF-rewrite timeout/aof_last_bgrewrite_status failing the adoption, and the exact --appendonly yes glob.

Approving, which clears our earlier CHANGES_REQUESTED. One non-blocking suggestion inline (the non-empty-target probe fails open, and the rollback's volume rm --force makes that dangerous), fine as a follow-up.

Comment thread deploy/vm/setup-vm.sh
# differs between rootful and rootless podman.
redis_adopt_target_nonempty() {
podman volume exists "$MOCA_REDIS_VOLUME" 2>/dev/null || return 1
[[ -n "$(podman run --rm -v "$MOCA_REDIS_VOLUME:/data" --entrypoint sh \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (carried over from the fb723a2 round, still open): this probe fails open. If the podman run itself fails (a pull or storage error, a volume that can't be mounted, a podman hiccup), stdout is empty, the target reads as "empty", and adoption goes ahead. The probe exists to protect the case where moca-redis already holds data, and that's exactly where it does harm: if redis_adopt_migrate then fails at any step, redis_adopt_rollback runs podman volume rm --force "$MOCA_REDIS_VOLUME" (L435) and deletes the sessions that were already there. Suggest treating a failed probe as "not empty" (or as an error), e.g. capture the output and the exit status separately and return 0 when the run fails. Also consider having the rollback remove the volume only if this run created it (volume exists before volume create), so a failed adoption can never destroy data it didn't write. Not blocking; fine as a follow-up.

@cwiklik
cwiklik merged commit 002f8b5 into rossoctl:main Oct 26, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-ai-review Request automated AI code review from clawgenti

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deploy/vm: setup-vm.sh re-run recreates sh-redis (no volume) and loses every session

3 participants