Skip to content

feat(pm-stack): gate the Kaneo rollback on fence + replay parity (#6816) - #14079

Merged
developing-today-fleet[bot] merged 2 commits into
mainfrom
lane-any-o-6816-kaneo-rollback
Nov 24, 2026
Merged

developing-today-fleet[bot] merged 2 commits into
mainfrom
lane-any-o-6816-kaneo-rollback

Conversation

@dezren39

@dezren39 dezren39 commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Next slice of #6816 (criterion 4: rollback restores the prior writer without losing writes). The migration plan already said rollback was operator steps; this PR drives the Kaneo half with pm-stack/scripts/kaneo-cutover.sh --mode rollback:

  • Refuses (exit 3, REFUSED receipt, no store touched) unless the promoted writer is FENCED via the existing fence-check.sh writer set — the DSN flip renames no container, so FENCED means no writer runs against either store.
  • Exports the window's writes (pg_dump of the target into --dump-file), replays them into the source, and demands exact table/row parity afterwards (exit 4 on mismatch).
  • Refuses --unreachable (exit 2): the writer being fenced here is local.
  • Writes a receipt (fence verdict, counts, verdict) with no DSN, mirroring promote. Never flips a DSN or restarts a service — the window operator does that per the runbook.

Plan doc §5/§6 updated to point at the driver.

Evidence

Ran on the laptop at 5a1d9d649d8:

  • bash pm-stack/scripts/kaneo-cutover.test.sh — all 20 checks pass (13 pre-existing + 7 new: refuse-unfenced, dump-target→replay-source direction, pass path + receipt, replay-mismatch exit 4, --unreachable exit 2, missing --dump-file exit 2, updated presync direction pin). Falsified first: the 3 gate tests failed with exit 2 (unknown mode) before the driver change.
  • bash pm-stack/scripts/fence-check.test.sh — all checks pass (untouched, regression).
  • shellcheck -S warning pm-stack/scripts/kaneo-cutover.sh — clean.
  • Suite is already wired into .github/workflows/pm-stack-tests.yml (no workflow change needed); nightly runs it.

Merge Danger

Low. Two files are the cutover driver and its fixture suite (stubbed pg binaries + fixture fence state — verify the gated sequence, not a live cutover); the third is plan prose. No live store is touched by this PR; the window executes --mode rollback for real later. Revertible without affecting what is there.

Closes nothing — #6816 stays open: the windowed cutover itself, the DSN flip/restarts, and a true new-host drill remain.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-24T04:23:47Z",
    "session_id": "ses_e5df44a0e5bffee3PXx8habvbw",
    "lane": null,
    "host": "amd",
    "worktree": "/home/user/git/fleet/any-o-6816-rollback",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/user/git/fleet/any-o-6816-rollback",
      "repo": "developing-today/code",
      "branch": "lane-any-o-6816-kaneo-rollback",
      "sha": "5a1d9d649d84eb76fca125da7a18be1aa9ca469e"
    },
    "auth_subject": "oc-code-06",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Adds --mode rollback to kaneo-cutover.sh: refuses unless the promoted
writer is fenced, exports the target delta, replays it into the source,
demands exact table/row parity, and writes a receipt with no DSN.
--unreachable is refused in this mode. Stub-tested (direction-aware
pg_dump/pg_restore stubs); plan doc §5/§6 point at the driver.

Lane any-o.
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 57 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1d548945-6455-44c2-8908-63e82c028c07
Commits

Reviewing files that changed from the base of the PR and between 813da2b and c74b5e7.

Files selected for processing: 3

  • pm-stack/STORE-MIGRATION-PLAN-6816.md
  • pm-stack/scripts/kaneo-cutover.sh
  • pm-stack/scripts/kaneo-cutover.test.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

# Conflicts:
#	pm-stack/scripts/kaneo-cutover.sh
@developing-today-fleet
developing-today-fleet Bot merged commit 012af48 into main Nov 24, 2026
2 of 3 checks passed
@developing-today-fleet
developing-today-fleet Bot deleted the lane-any-o-6816-kaneo-rollback branch November 24, 2026 09:44
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