Skip to content

Keep a committed namespace ready when only Redis or the ack fails (RD-1) - #48

Merged
dbccpage merged 2 commits into
mainfrom
claude/rd1-post-commit-recovery
Nov 11, 2026
Merged

dbccpage merged 2 commits into
mainfrom
claude/rd1-post-commit-recovery

Conversation

@dbccpage

Copy link
Copy Markdown
Owner

Requested by Jeremy · project thread

What

  • Publisher.publish raises PostCommitError (a ProductionError) for any refusal after Authority.publish returned: mirror write/readback or the source ack.
  • PostgresWorker.poll re-raises PostCommitError and a short list of operational reasons (mirror_publication_unconfirmed, source_slot_competing_consumer, invalid_freshness_observation, heartbeat_generation_changed, generation_conflict, stale_or_expired_owner) without writing status=blocked. Schema/DML safety refusals (source_schema_changed, source_offset_gap, ...) still block.
  • A replayed already-committed transaction (offset <= previous) republishes the mirror before acking, so the next poll heals even without recover().
  • A block attempt by a fenced-out worker no longer masks the original refusal.

Evidence (local PG 16.15 + wal2json 2.5 + Redis 7, in the cloud container)

  • New native test test_production_mirror_readback_loss_after_commit_keeps_namespace_ready[recover|poll] injects GET -> None in RedisMirror.put. On main it ends blocked; with this PR recover() or the next poll(), then Reader.read(), hit without re-bootstrap.
  • test_production_transient_slot_competition_does_not_block, plus two sqlite unit tests for PostCommitError.
  • black --check . and mypy smplcache demo scripts/check_sql_coverage.py: clean. pytest --ignore=tests/test_live_containers.py --ignore=tests/production_native.py: 2274 passed. Native suite (non-cluster, non-disruptive): green locally.

Generated by Claude Code

A mirror readback miss, a transient competing peek, or a clock-step
freshness refusal after PostgreSQL committed generation G no longer
writes status=blocked. Publisher.publish raises PostCommitError for any
refusal after Authority.publish returned; PostgresWorker.poll re-raises it
and a small set of operational reasons without blocking, and a replayed
already-committed transaction republishes the mirror before acking.
Schema/DML safety refusals still block.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0194kAmY4QqQGabdoB3xGFsr
# Conflicts:
#	smplcache/production_postgres.py
@dbccpage
dbccpage removed this pull request from stack #52 November 11, 2026 10:38
@dbccpage
dbccpage merged commit bc6eb30 into main Nov 11, 2026
5 checks passed
@dbccpage
dbccpage deleted the claude/rd1-post-commit-recovery branch November 11, 2026 10:38
dbccpage pushed a commit that referenced this pull request Nov 11, 2026
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.

2 participants