fix(palace): postgres backend is a multi-process-writer backend - #398
Merged
Conversation
Post-v3.7.0-sync production regression (first deploy, 2026-08-09):
upstream's new process-lifetime MCP writer lease exempts only
{pgvector, qdrant}, so the fork's postgres backend (MemPalace#665 lineage,
behind palace-daemon) was treated as single-writer. The daemon's
embedded MCP server took the lease at startup and every
`mempalace mine` subprocess it spawns for POST /mine refused with
'palace ... is held by PID <daemon> (main.py)' — 45 refused transcript
ingests in hook.log before detection.
postgres delegates all cross-process concurrency to the postgres
server, exactly the documented opt-out condition. One-word fix + test.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe change classifies PostgreSQL as a multi-process writer backend. Tests verify that PostgreSQL does not require single-writer ownership. ChangesPostgreSQL writer coordination
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Post-sync production regression, caught in the wrap-up sweep: upstream v3.7's process-lifetime MCP writer lease (
_acquire_mcp_writer_lock) exempts only{pgvector, qdrant}via_MULTI_PROCESS_WRITER_BACKENDS. The fork'spostgresbackend wasn't in the list, so the daemon's embedded MCP server took the lease at startup — and everymempalace minesubprocess the daemon spawns forPOST /mineself-refused withpalace … is held by PID <daemon> (main.py). 45 refused transcript ingests in hook.log since the 3.7.0 deploy.postgres coordinates concurrent clients server-side — exactly the documented opt-out condition (same as pgvector). One-word fix + regression assertion in the existing ownership test.
Test plan
tests/test_palace.pyextended:backend_requires_single_writer('postgres') is Falsetest_palace.py+test_mcp_server.pysuites green locallyPOST /minereturns returncode 0 and hook.log refusals stop🤖 Generated with Claude Code
Summary by CodeRabbit