Skip to content

Enhancement: Support Midge writer handoff in Fitz - #552

Merged
smiggleworth merged 1 commit into
mainfrom
feat/midge-writer-handoff
Nov 29, 2026
Merged

smiggleworth merged 1 commit into
mainfrom
feat/midge-writer-handoff

Conversation

@smiggleworth

@smiggleworth smiggleworth commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Type

Enhancement: runtime storage startup, readiness, and shutdown behavior, with operator documentation.

Linked issue

Related cross-repository work: cntryl/cassie#1595. No Fitz-specific issue exists; this Fitz change was requested directly.

Summary

  • Upgrade the Fitz workspace dependency to published cntryl-midge 0.7.0.
  • Expose FITZ_STORAGE_WRITER_GENERATION and optional FITZ_STORAGE_WRITER_DRAIN_GRACE_MS for shared local/cloud storage.
  • Prepare/promote replacements through Midge, withdraw readiness while the incumbent drains, restore readiness if a handoff is deferred, and shut down after retirement.

User/operator impact

Operators can replace Fitz writers without inventing a process-local generation. Memory mode rejects handoff configuration. Midge owns the transaction drain grace; Fitz withdraws readiness during that phase and stops after promotion.

Current and expected behavior

Fitz previously opened Midge without a writer-handoff configuration. It now cold-opens normally, and when Midge reports an active writer it prepares and promotes a replacement with the explicit higher generation. Fitz observes the Midge writer state and updates readiness and shutdown behavior accordingly.

Scope

Changes are limited to Fitz dependency/configuration, storage startup, broker readiness/shutdown integration, tests, and operator/developer docs. No Midge source or workflow changes are included.

Evidence and support status

  • A local generation 1 to generation 2 test verifies that the incumbent reaches Retired and the replacement serves.
  • Broker shutdown tests cover readiness withdrawal, deferred handoff recovery, handoff shutdown, and unexpected retirement.
  • Configuration tests cover unset/default behavior, invalid and partial settings, and memory-mode rejection.
  • No pre-change red run was recorded. Targeted handoff tests pass; the full workspace test suite is still running locally.

Validation

  • PASS: cargo fmt --all -- --check
  • PASS: strict Clippy on the CI-pinned Rust 1.99.1 toolchain: cargo clippy --locked --workspace --all-targets --all-features -- -D warnings -D clippy::pedantic
  • PASS: cntryl-tools validate-tests (2806/2806) and cntryl-tools check-module-sizes --root crates/fitz-server --config .cntryl/repository.toml
  • PASS: cargo test --locked -p fitz --lib writer (17 passed)
  • PASS: cargo test --locked --workspace (3442 passed, 8 ignored)
  • PASS: git diff --check
  • PASS: all hosted checks on exact head 3b53423538c8d630bedd32ddc9f7a516c9ea57a2 (backend-checks/crates/e2e, frontend, three integrations, Analyze, and CodeQL).

Acceptance criteria

  • Support explicit monotonic generations for shared local/cloud storage and preserve Midge's default grace when unset.
  • Reject malformed, partial, zero, overflowed, and memory-mode configuration.
  • Withdraw storage readiness during drain, restore it on deferred handoff, and shut down after retirement.
  • Pass full local validation and exact-head hosted checks.

Status

Squash merged as 03db3133dab1287a0d2c51aa1eb2c676849db3d4 after full local validation and green exact-head hosted checks.

@smiggleworth smiggleworth added the enhancement New feature or request label Nov 29, 2026
@smiggleworth
smiggleworth merged commit 03db313 into main Nov 29, 2026
12 checks passed
@smiggleworth
smiggleworth deleted the feat/midge-writer-handoff branch November 29, 2026 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant