René's URL Explorer Experiment


Title: feat(run-engine): flag to route getSnapshotsSince through read replica by ericallam · Pull Request #3423 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: feat(run-engine): flag to route getSnapshotsSince through read replica by ericallam · Pull Request #3423 · triggerdotdev/trigger.dev

X Title: feat(run-engine): flag to route getSnapshotsSince through read replica by ericallam · Pull Request #3423 · triggerdotdev/trigger.dev

Description: Summary Adds RUN_ENGINE_READ_REPLICA_SNAPSHOTS_SINCE_ENABLED (default "0"). When enabled, the Prisma reads inside RunEngine.getSnapshotsSince run against the read-only replica client instead of the primary. Offloads the snapshot-polling queries fired by every running task runner off the writer. Why getSnapshotsSince is called from the managed runner's fetch-and-process loop (once per poll interval, plus on every snapshot-change notification). It runs four sequential reads per call — one findFirst by snapshot id, one findMany on snapshots with createdAt > X, one raw SQL against _completedWaitpoints, and chunked findMany on waitpoint. Per concurrent run, every few seconds. It's read-only, tolerates a small amount of staleness, and is an obvious candidate for the replica. Replica-lag considerations Step 1 "since snapshot not found": if the runner just received a snapshot id from the primary and asks the replica before it replicates, the function throws and the caller treats the response as an error (runner falls back to a metadata refresh). Self-correcting, not silent. Step 2 missing newly-created snapshots: the next poll's createdAt > sinceSnapshot.createdAt filter still picks them up once the replica catches up. Waitpoint junction race: the riskiest path — if a latest snapshot is replicated but its _completedWaitpoints join rows aren't yet, the runner could advance past that snapshot with completedWaitpoints: []. WAL/storage-level replication replays commits in order, so in practice both should appear atomically on the reader, but the race window is why the flag ships disabled. Aurora reader shrinks all three windows to single-digit ms in typical conditions, and its storage-level replication gives atomic visibility of committed transactions on the reader. Test plan Flip the flag on in a non-prod environment, confirm snapshot polling behaves normally and getSnapshotsSince errors in Sentry stay flat. Verify writer query volume drops and reader query volume rises on the snapshot-polling queries. Keep an eye on AuroraReplicaLag (or equivalent) during rollout.

Open Graph Description: Summary Adds RUN_ENGINE_READ_REPLICA_SNAPSHOTS_SINCE_ENABLED (default "0"). When enabled, the Prisma reads inside RunEngine.getSnapshotsSince run against the read-only replica client inst...

X Description: Summary Adds RUN_ENGINE_READ_REPLICA_SNAPSHOTS_SINCE_ENABLED (default "0"). When enabled, the Prisma reads inside RunEngine.getSnapshotsSince run against the read-only replica cli...

Opengraph URL: https://github.com/triggerdotdev/trigger.dev/pull/3423

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:f378d23e-3dd5-3720-053b-1c466a1b6a14
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDF30:191C90:22B18:2F87D:6AFAF4F2
html-safe-nonce84b1d5140b20b0b4cd59fc0387f272ff4cef6c5d93a95c22b31e6a9a3ed50764
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjMwOjE5MUM5MDoyMkIxODoyRjg3RDo2QUZBRjRGMiIsInZpc2l0b3JfaWQiOiIyMzYxMDUxNjMzMDI3ODM5MjE4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmace9fd2dccdc579002ce83bf0efb302c0b4584debb0e23182f82d9f0b1efceb225
hovercard-subject-tagpull_request:3566172752
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/triggerdotdev/trigger.dev/pull/3423/files
twitter:imagehttps://avatars.githubusercontent.com/u/534?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/534?s=400&v=4
og:image:altSummary Adds RUN_ENGINE_READ_REPLICA_SNAPSHOTS_SINCE_ENABLED (default "0"). When enabled, the Prisma reads inside RunEngine.getSnapshotsSince run against the read-only replica client inst...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None0178036d8230524a18422872393ab7e708443ae4c2047f758560a2db870c1913
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git
octolytics-dimension-user_id95297378
octolytics-dimension-user_logintriggerdotdev
octolytics-dimension-repository_id572570113
octolytics-dimension-repository_nwotriggerdotdev/trigger.dev
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id572570113
octolytics-dimension-repository_network_root_nwotriggerdotdev/trigger.dev
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasea85e96a83bed7871993e6b1ffda24105928eee17
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/pull/3423/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F3423%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F3423%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=triggerdotdev%2Ftrigger.dev
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/3423/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/3423/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/3423/files
triggerdotdevhttps://github.com/triggerdotdev
trigger.devhttps://github.com/triggerdotdev/trigger.dev
Codehttps://github.com/triggerdotdev/trigger.dev
Issues203 (203)https://github.com/triggerdotdev/trigger.dev/issues
Pull requests67 (67)https://github.com/triggerdotdev/trigger.dev/pulls
Discussionshttps://github.com/triggerdotdev/trigger.dev/discussions
Actionshttps://github.com/triggerdotdev/trigger.dev/actions
Projectshttps://github.com/triggerdotdev/trigger.dev/projects
Security and quality39 (39)https://github.com/triggerdotdev/trigger.dev/security
Insightshttps://github.com/triggerdotdev/trigger.dev/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
ericallamhttps://github.com/ericallam
mainhttps://github.com/triggerdotdev/trigger.dev/tree/main
feat/read-replica-snapshots-sincehttps://github.com/triggerdotdev/trigger.dev/tree/feat/read-replica-snapshots-since
Conversation 4 https://github.com/triggerdotdev/trigger.dev/pull/3423
Commits 1 https://github.com/triggerdotdev/trigger.dev/pull/3423/commits
Checks 47 https://github.com/triggerdotdev/trigger.dev/pull/3423/checks
Files changed https://github.com/triggerdotdev/trigger.dev/pull/3423/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3423/files
feat(run-engine): flag to route getSnapshotsSince through read replica https://github.com/triggerdotdev/trigger.dev/pull/3423/files#top
Show all changes 1 commit https://github.com/triggerdotdev/trigger.dev/pull/3423/files
167d0d3 feat(run-engine): flag to route getSnapshotsSince through read replica ericallam Apr 22, 2026 https://github.com/triggerdotdev/trigger.dev/pull/3423/commits/167d0d3857d7060ba3cc33f4953d4b893578b886
Clear filters https://github.com/triggerdotdev/trigger.dev/pull/3423/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3423/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3423/files
read-replica-snapshots-since.md https://github.com/triggerdotdev/trigger.dev/pull/3423/files#diff-085c5dc82f716cb0883c69d362e553d0c37da55e4feb755af1a32e1b61b6f422
env.server.ts https://github.com/triggerdotdev/trigger.dev/pull/3423/files#diff-f8823615ef72da3494e74de9e62b2fa31315ed9360f17bc06ab943f4dc25f4fd
runEngine.server.ts https://github.com/triggerdotdev/trigger.dev/pull/3423/files#diff-44b2620e883d51908283afcb71504e2318df61525d0fbbf15b60d18b400a8c59
index.ts https://github.com/triggerdotdev/trigger.dev/pull/3423/files#diff-d29236a78d70dd8a019a2ec308d8eab0eda9f5fbf116d19d5c99b8f573a1b5df
types.ts https://github.com/triggerdotdev/trigger.dev/pull/3423/files#diff-81c21d7967ac61777b1a20d53a0f821068d182af9f44ec4bd64b967c8fbd6d92
.server-changes/read-replica-snapshots-since.mdhttps://github.com/triggerdotdev/trigger.dev/pull/3423/files#diff-085c5dc82f716cb0883c69d362e553d0c37da55e4feb755af1a32e1b61b6f422
View file https://github.com/triggerdotdev/trigger.dev/blob/167d0d3857d7060ba3cc33f4953d4b893578b886/.server-changes/read-replica-snapshots-since.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3423/{{ revealButtonHref }}
apps/webapp/app/env.server.tshttps://github.com/triggerdotdev/trigger.dev/pull/3423/files#diff-f8823615ef72da3494e74de9e62b2fa31315ed9360f17bc06ab943f4dc25f4fd
View file https://github.com/triggerdotdev/trigger.dev/blob/167d0d3857d7060ba3cc33f4953d4b893578b886/apps/webapp/app/env.server.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3423/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3423/files#diff-f8823615ef72da3494e74de9e62b2fa31315ed9360f17bc06ab943f4dc25f4fd
https://github.com/triggerdotdev/trigger.dev/pull/3423/files#diff-f8823615ef72da3494e74de9e62b2fa31315ed9360f17bc06ab943f4dc25f4fd
apps/webapp/app/v3/runEngine.server.tshttps://github.com/triggerdotdev/trigger.dev/pull/3423/files#diff-44b2620e883d51908283afcb71504e2318df61525d0fbbf15b60d18b400a8c59
View file https://github.com/triggerdotdev/trigger.dev/blob/167d0d3857d7060ba3cc33f4953d4b893578b886/apps/webapp/app/v3/runEngine.server.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3423/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3423/files#diff-44b2620e883d51908283afcb71504e2318df61525d0fbbf15b60d18b400a8c59
https://github.com/triggerdotdev/trigger.dev/pull/3423/files#diff-44b2620e883d51908283afcb71504e2318df61525d0fbbf15b60d18b400a8c59
internal-packages/run-engine/src/engine/index.tshttps://github.com/triggerdotdev/trigger.dev/pull/3423/files#diff-d29236a78d70dd8a019a2ec308d8eab0eda9f5fbf116d19d5c99b8f573a1b5df
View file https://github.com/triggerdotdev/trigger.dev/blob/167d0d3857d7060ba3cc33f4953d4b893578b886/internal-packages/run-engine/src/engine/index.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3423/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3423/files#diff-d29236a78d70dd8a019a2ec308d8eab0eda9f5fbf116d19d5c99b8f573a1b5df
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3423/files
https://github.com/triggerdotdev/trigger.dev/pull/3423/files#diff-d29236a78d70dd8a019a2ec308d8eab0eda9f5fbf116d19d5c99b8f573a1b5df
internal-packages/run-engine/src/engine/types.tshttps://github.com/triggerdotdev/trigger.dev/pull/3423/files#diff-81c21d7967ac61777b1a20d53a0f821068d182af9f44ec4bd64b967c8fbd6d92
View file https://github.com/triggerdotdev/trigger.dev/blob/167d0d3857d7060ba3cc33f4953d4b893578b886/internal-packages/run-engine/src/engine/types.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/3423/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/3423/files#diff-81c21d7967ac61777b1a20d53a0f821068d182af9f44ec4bd64b967c8fbd6d92
https://github.com/triggerdotdev/trigger.dev/pull/3423/files#diff-81c21d7967ac61777b1a20d53a0f821068d182af9f44ec4bd64b967c8fbd6d92
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/3423/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.