Skip to content

feat(world-postgres): make startup recovery optional - #3690

Open
joeyhotz wants to merge 1 commit into
vercel:mainfrom
joeyhotz:fix/postgres-optional-boot-recovery
Open

feat(world-postgres): make startup recovery optional#3690
joeyhotz wants to merge 1 commit into
vercel:mainfrom
joeyhotz:fix/postgres-optional-boot-recovery

Conversation

@joeyhotz

@joeyhotz joeyhotz commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Description

world-postgres currently scans and re-enqueues every pending/running run whenever a process calls start(). In a horizontally scaled deployment, an ordinary replica start is not evidence that the fleet failed, so this can create a burst of redundant replay work.

Add recoverActiveRuns to PostgresWorldConfig, matching the existing Local World option. It defaults to true. With false, start() still starts Graphile Worker and consumes durable/new jobs, but skips the broad storage scan.

This is an operational escape hatch, not leader election or exactly-once machinery. Setting it to false everywhere removes automatic startup repair for an active run with no runnable job, so recovery must be handled separately.

Related work: #2544 proposes a broader start({ onRestart }) control; #3162 makes boot recovery more selective and deduplicates its jobs; #3138 tracks owner-aware/single-flight recovery. This change is the smaller world-postgres construction-time escape hatch. If #2544 lands, precedence between the two controls should be defined deliberately.

Docs Preview

Pending Vercel Labs authorization for the external fork. Changed route: /v5/docs/configuration/worlds#recoveractiveruns.

How did you test your changes?

  • Added a regression test with an active stored run and recoverActiveRuns: false.
  • The test proves Graphile Worker starts while storage listing and recovery enqueueing do not run.
  • pnpm exec vitest run src/reenqueue.test.ts — 13/13 passed.
  • pnpm typecheck and pnpm build passed for @workflow/world-postgres.

PR Checklist - Required to merge

  • 📦 Added a minor changeset for @workflow/world-postgres
  • 🔒 DCO sign-off is present
  • 📝 Pinged @vercel/workflow after the PR and core checks were verified

@changeset-bot

changeset-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ac36252

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@workflow/world-postgres Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

@joeyhotz is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@joeyhotz
joeyhotz marked this pull request as ready for review August 20, 2026 04:49
@joeyhotz
joeyhotz requested review from a team, fantix and msullivan as code owners August 20, 2026 04:49
@joeyhotz

joeyhotz commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Pinging @vercel/workflow.

@joeyhotz
joeyhotz force-pushed the fix/postgres-optional-boot-recovery branch from 3a3e72a to dd36097 Compare August 20, 2026 06:17
@VaguelySerious

Copy link
Copy Markdown
Member

@joeyhotz Commits must be signed for me to be able to merge this

@joeyhotz
joeyhotz force-pushed the fix/postgres-optional-boot-recovery branch from dd36097 to ec2dfc3 Compare August 21, 2026 04:49
@joeyhotz

Copy link
Copy Markdown
Contributor Author

Should be signed now, apologies @VaguelySerious 🙏

Signed-off-by: Joey Hotz <joeyhotz1@gmail.com>
@joeyhotz
joeyhotz force-pushed the fix/postgres-optional-boot-recovery branch from ec2dfc3 to ac36252 Compare August 21, 2026 04:51
@VaguelySerious

Copy link
Copy Markdown
Member

@joeyhotz

image

Sadly it seems not

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