PostgreSQL Advisory Lock Coordination with Contract Tests (TDD) #239
Labels
No labels
adr
automated
bug
chore
dependencies
documentation
enhancement
epic
github-actions
P1-high
P2-medium
P3-low
release
research
rust
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jwilger/eventcore#239
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Overview
Implement PostgreSQL coordination using advisory locks on dedicated connections per ARCHITECTURE.md. Follows the EventStore/Commanded pattern: subscriptions table tracks checkpoints, advisory locks on dedicated connections provide coordination.
Parent Epic: #237
Core Pattern (per ARCHITECTURE.md)
Subscriptions Table - Checkpoint tracking:
(subscription_name TEXT PRIMARY KEY, last_position BIGINT, updated_at TIMESTAMPTZ)Advisory Locks on Dedicated Connections - Coordination:
pg_try_advisory_lock(hash(subscription_name))(non-blocking per ADR-028)Implementation Components
ProjectionRunnerKey Points (per ARCHITECTURE.md + ADR-028)
is_valid()checks in projection loop - connection lifecycle handles itheartbeat()calls - connection alive = leadership heldAcceptance Criteria
LockNotAcquirederror when leadership unavailable (non-blocking per ADR-028)API Shape (per ADR-028)
TDD Approach
References
Updated to incorporate ADR-028 decision: non-blocking try-acquire