Skip to content

fix(scheduler): add advisory-lock leader election - #675

Open
woahwhattheheck wants to merge 12 commits into
Protocol-Guild:mainfrom
woahwhattheheck:sol56/payd501-advisory-leader-20261004
Open

woahwhattheheck wants to merge 12 commits into
Protocol-Guild:mainfrom
woahwhattheheck:sol56/payd501-advisory-leader-20261004

Conversation

@woahwhattheheck

Copy link
Copy Markdown

Fixes #501

Summary

  • Use a dedicated PostgreSQL session-scoped advisory lock so only one replica owns each scheduler pass.
  • Probe leadership every 15 seconds, keeping the failover target below 30 seconds when the current leader disappears.
  • Preserve the existing row-level SKIP LOCKED claims and scheduled-job execution path.
  • Add focused leader/non-leader coverage without introducing a distributed queue.

Validation

The exact carrier changes two files and the repository's Build Project and Run Tests workflow completed successfully on source head 41bb59d74726e32c27593491c7ce29255a0880e0 (run 37249051878). The retained handoff includes focused leader/non-leader coverage. No production multi-pod soak or failover benchmark is claimed here.

Source: woahwhattheheck/PayD:sol56/payd501-advisory-leader-20261004.

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.

Add leader election for scheduled background jobs

1 participant