René's URL Explorer Experiment


Title: improvement(logs): move per-block progress markers to Redis to cut write amplification by waleedlatif1 · Pull Request #5248 · simstudioai/sim · GitHub

Open Graph Title: improvement(logs): move per-block progress markers to Redis to cut write amplification by waleedlatif1 · Pull Request #5248 · simstudioai/sim

X Title: improvement(logs): move per-block progress markers to Redis to cut write amplification by waleedlatif1 · Pull Request #5248 · simstudioai/sim

Description: Summary Per-block lastStartedBlock/lastCompletedBlock progress markers were persisted with a jsonb_set UPDATE on workflow_execution_logs on every block start and complete (~2N row UPDATEs per run) — the heaviest write query on the table by volume. These are live progress breadcrumbs with no DB-polling consumer (live progress streams from the executor over WebSocket); their only durable value is a breadcrumb folded into the final record. Behind the redis-progress-markers flag, markers now live in Redis during the run and are folded into the single terminal UPDATE at completion — dropping per-run row UPDATEs from ~2N+1 to 1. How it works New progress-markers.ts: one Redis HASH per execution (execution:progress:{id}), atomic Lua monotonic-guard writes that preserve the existing <= ordering, a reservation-aligned TTL backstop, and graceful no-op when Redis is unavailable. Deterministic GC: markers are cleared at every terminal/pause boundary (complete/error/cancel/pause via completeWorkflowExecution, plus markExecutionAsFailed); the TTL only covers crashed runs. Paused executions hold zero Redis keys. The write path is resolved once per logging session, so a run never mixes Redis and SQL paths. Completion folds markers into the record (Redis wins, falls back to markers already on the row); in-flight detail reads merge live markers for parity. Extracted getExecutionReservationTtlMs() so the marker TTL and the admission-slot TTL share one source of truth. Rollout Flag-gated and off by default — shipping is a no-op (legacy jsonb_set path unchanged). Enable to cut the write amplification; flip off for instant rollback. Falls back to the legacy SQL path when the flag is off, Redis is unavailable, or flag resolution fails — safe for self-hosted deployments without Redis. Type of Change Improvement (performance / DB write reduction) Testing New unit tests for the marker store (monotonic guard, get/clear, malformed-JSON safety, graceful no-op without Redis). New logging-session tests: flag-on routes to Redis (not the row), flag-off uses jsonb_set, flag-resolution failure falls back to SQL, and markExecutionAsFailed clears markers. Existing logger/execution-core/usage-reservation suites pass unchanged (carry-forward fallback preserved). tsc clean, biome clean. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Summary Per-block lastStartedBlock/lastCompletedBlock progress markers were persisted with a jsonb_set UPDATE on workflow_execution_logs on every block start and complete (~2N row UPDATEs per run)...

X Description: Summary Per-block lastStartedBlock/lastCompletedBlock progress markers were persisted with a jsonb_set UPDATE on workflow_execution_logs on every block start and complete (~2N row UPDATEs per run)...

Opengraph URL: https://github.com/simstudioai/sim/pull/5248

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:11ad0d8b-6922-15ae-33b7-431c0ea2ac05
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idAB8E:1AE782:266F90:35656A:6AFB52AC
html-safe-noncee58d157d83027ac137f7b7f6e636b5ca9d1f2c2af0d383504ba8a1f148b17e5a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjhFOjFBRTc4MjoyNjZGOTA6MzU2NTZBOjZBRkI1MkFDIiwidmlzaXRvcl9pZCI6IjU2NzIwNTg5MDM4MTQ5NTE1OTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac0a0f948d984a18ef7523ed7de72dbdb741f7a27438afafc6bb1576a0cea86c09
hovercard-subject-tagpull_request:3949136909
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/simstudioai/sim/pull/5248/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altSummary Per-block lastStartedBlock/lastCompletedBlock progress markers were persisted with a jsonb_set UPDATE on workflow_execution_logs on every block start and complete (~2N row UPDATEs per run)...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
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
releasecbf66c024bb6d10e6955baa7413c54cf13a201bb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/5248/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F5248%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%2Fsimstudioai%2Fsim%2Fpull%2F5248%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=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/5248/files
Reloadhttps://github.com/simstudioai/sim/pull/5248/files
Reloadhttps://github.com/simstudioai/sim/pull/5248/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests197 (197)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
redis-progress-markershttps://github.com/simstudioai/sim/tree/redis-progress-markers
Conversation 33 https://github.com/simstudioai/sim/pull/5248
Commits 7 https://github.com/simstudioai/sim/pull/5248/commits
Checks 15 https://github.com/simstudioai/sim/pull/5248/checks
Files changed https://github.com/simstudioai/sim/pull/5248/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5248/files
improvement(logs): move per-block progress markers to Redis to cut write amplification https://github.com/simstudioai/sim/pull/5248/files#top
Show all changes 7 commits https://github.com/simstudioai/sim/pull/5248/files
70ffdd1 improvement(logs): move per-block progress markers to Redis to cut wr… waleedlatif1 Jun 27, 2026 https://github.com/simstudioai/sim/pull/5248/commits/70ffdd19cafa1478998d0b0c64fd353a550999c3
f4d8086 fix(logs): SQL fallback when Redis marker write fails, fold markers o… waleedlatif1 Jun 27, 2026 https://github.com/simstudioai/sim/pull/5248/commits/f4d8086790d8526c33d628c2a9ece416dfd803eb
27afbce chore(logs): convert inline marker comments to TSDoc waleedlatif1 Jun 27, 2026 https://github.com/simstudioai/sim/pull/5248/commits/27afbce9cbc8823b74703bd239d86555dc36c471
08f54ef fix(logs): preserve markers when the completion read fails waleedlatif1 Jun 27, 2026 https://github.com/simstudioai/sim/pull/5248/commits/08f54efffb6f281a36e5b09dc63af08ed8dfb719
6c4c289 fix(logs): resolve marker store split-brain by latest-timestamp-wins … waleedlatif1 Jun 27, 2026 https://github.com/simstudioai/sim/pull/5248/commits/6c4c2897eaeb905051eb706ae3509a1ae759973a
811846e fix(logs): harden Lua marker guard against non-table decoded values waleedlatif1 Jun 27, 2026 https://github.com/simstudioai/sim/pull/5248/commits/811846eca65f8241e733093b60feeb9dc595fbc4
6669170 perf(logs): skip completion Redis read/clear when markers went to SQL waleedlatif1 Jun 27, 2026 https://github.com/simstudioai/sim/pull/5248/commits/66691709e2090a564889a3c04a3fe4873e60a868
Clear filters https://github.com/simstudioai/sim/pull/5248/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5248/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5248/files
usage-reservation.ts https://github.com/simstudioai/sim/pull/5248/files#diff-c4a346abbf778d4c42f4af5a8ee905400038541d3055e83b56d3c3d635d3d2b8
env.ts https://github.com/simstudioai/sim/pull/5248/files#diff-7db3fc610ff89cf819c4eb69b43ec37ae18530e1861f6c322faeb62f8f48f298
feature-flags.ts https://github.com/simstudioai/sim/pull/5248/files#diff-3e4749df9f5e590f0e3d17cc4e1fed55b8788c93f823e02fba3409ba2ca708c2
types.ts https://github.com/simstudioai/sim/pull/5248/files#diff-f8c429beac8e79bc87bc627c92f4a79e9a063b1984e45414a84c389bcf62bd06
logger.ts https://github.com/simstudioai/sim/pull/5248/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
logging-session.test.ts https://github.com/simstudioai/sim/pull/5248/files#diff-b801a3e7faa08a7816dee0ee9dc4be20c2c9e971d6f77a7d6c7c78e6f9b7b18d
logging-session.ts https://github.com/simstudioai/sim/pull/5248/files#diff-cac398bb0e1ce1cf9854fa04ba1ec432651c64499078382ef8008a4316b95515
progress-markers.test.ts https://github.com/simstudioai/sim/pull/5248/files#diff-9574ea67cfaa26d35eccbc77a4b18fda58a252ad9d83c166299d1a0c5a473235
progress-markers.ts https://github.com/simstudioai/sim/pull/5248/files#diff-dd8a6f610068bb2f34ce39d694af1877e3a16143039d4dfc539f0644906883fb
fetch-log-detail.ts https://github.com/simstudioai/sim/pull/5248/files#diff-29277f1a80d2d62e6548e48d6db9f1dc679a917e58da6cf4df1a8bea65598e52
types.ts https://github.com/simstudioai/sim/pull/5248/files#diff-00a9e37eb94b5673e846acc72eefe0ae0b95284886dd7619135976683011898b
apps/sim/lib/billing/calculations/usage-reservation.tshttps://github.com/simstudioai/sim/pull/5248/files#diff-c4a346abbf778d4c42f4af5a8ee905400038541d3055e83b56d3c3d635d3d2b8
View file https://github.com/simstudioai/sim/blob/66691709e2090a564889a3c04a3fe4873e60a868/apps/sim/lib/billing/calculations/usage-reservation.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5248/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5248/files#diff-c4a346abbf778d4c42f4af5a8ee905400038541d3055e83b56d3c3d635d3d2b8
https://github.com/simstudioai/sim/pull/5248/files#diff-c4a346abbf778d4c42f4af5a8ee905400038541d3055e83b56d3c3d635d3d2b8
https://github.com/simstudioai/sim/pull/5248/files#diff-c4a346abbf778d4c42f4af5a8ee905400038541d3055e83b56d3c3d635d3d2b8
https://github.com/simstudioai/sim/pull/5248/files#diff-c4a346abbf778d4c42f4af5a8ee905400038541d3055e83b56d3c3d635d3d2b8
https://github.com/simstudioai/sim/pull/5248/files#diff-c4a346abbf778d4c42f4af5a8ee905400038541d3055e83b56d3c3d635d3d2b8
https://github.com/simstudioai/sim/pull/5248/files#diff-c4a346abbf778d4c42f4af5a8ee905400038541d3055e83b56d3c3d635d3d2b8
apps/sim/lib/core/config/env.tshttps://github.com/simstudioai/sim/pull/5248/files#diff-7db3fc610ff89cf819c4eb69b43ec37ae18530e1861f6c322faeb62f8f48f298
View file https://github.com/simstudioai/sim/blob/66691709e2090a564889a3c04a3fe4873e60a868/apps/sim/lib/core/config/env.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5248/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5248/files#diff-7db3fc610ff89cf819c4eb69b43ec37ae18530e1861f6c322faeb62f8f48f298
https://github.com/simstudioai/sim/pull/5248/files#diff-7db3fc610ff89cf819c4eb69b43ec37ae18530e1861f6c322faeb62f8f48f298
apps/sim/lib/core/config/feature-flags.tshttps://github.com/simstudioai/sim/pull/5248/files#diff-3e4749df9f5e590f0e3d17cc4e1fed55b8788c93f823e02fba3409ba2ca708c2
View file https://github.com/simstudioai/sim/blob/66691709e2090a564889a3c04a3fe4873e60a868/apps/sim/lib/core/config/feature-flags.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5248/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5248/files#diff-3e4749df9f5e590f0e3d17cc4e1fed55b8788c93f823e02fba3409ba2ca708c2
https://github.com/simstudioai/sim/pull/5248/files#diff-3e4749df9f5e590f0e3d17cc4e1fed55b8788c93f823e02fba3409ba2ca708c2
apps/sim/lib/core/execution-limits/types.tshttps://github.com/simstudioai/sim/pull/5248/files#diff-f8c429beac8e79bc87bc627c92f4a79e9a063b1984e45414a84c389bcf62bd06
View file https://github.com/simstudioai/sim/blob/66691709e2090a564889a3c04a3fe4873e60a868/apps/sim/lib/core/execution-limits/types.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5248/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5248/files#diff-f8c429beac8e79bc87bc627c92f4a79e9a063b1984e45414a84c389bcf62bd06
https://github.com/simstudioai/sim/pull/5248/files#diff-f8c429beac8e79bc87bc627c92f4a79e9a063b1984e45414a84c389bcf62bd06
apps/sim/lib/logs/execution/logger.tshttps://github.com/simstudioai/sim/pull/5248/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
View file https://github.com/simstudioai/sim/blob/66691709e2090a564889a3c04a3fe4873e60a868/apps/sim/lib/logs/execution/logger.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5248/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5248/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
https://github.com/simstudioai/sim/pull/5248/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
https://github.com/simstudioai/sim/pull/5248/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
https://github.com/simstudioai/sim/pull/5248/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
https://github.com/simstudioai/sim/pull/5248/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
https://github.com/simstudioai/sim/pull/5248/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
https://github.com/simstudioai/sim/pull/5248/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
https://github.com/simstudioai/sim/pull/5248/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
https://github.com/simstudioai/sim/pull/5248/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
https://github.com/simstudioai/sim/pull/5248/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
https://github.com/simstudioai/sim/pull/5248/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
https://github.com/simstudioai/sim/pull/5248/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
https://github.com/simstudioai/sim/pull/5248/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
https://github.com/simstudioai/sim/pull/5248/files#diff-c93eef5145bbe011ec0c231c435952a4a5d8f1826332935030595b98b5980ee6
apps/sim/lib/logs/execution/logging-session.test.tshttps://github.com/simstudioai/sim/pull/5248/files#diff-b801a3e7faa08a7816dee0ee9dc4be20c2c9e971d6f77a7d6c7c78e6f9b7b18d
View file https://github.com/simstudioai/sim/blob/66691709e2090a564889a3c04a3fe4873e60a868/apps/sim/lib/logs/execution/logging-session.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5248/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5248/files#diff-b801a3e7faa08a7816dee0ee9dc4be20c2c9e971d6f77a7d6c7c78e6f9b7b18d
https://github.com/simstudioai/sim/pull/5248/files#diff-b801a3e7faa08a7816dee0ee9dc4be20c2c9e971d6f77a7d6c7c78e6f9b7b18d
https://github.com/simstudioai/sim/pull/5248/files#diff-b801a3e7faa08a7816dee0ee9dc4be20c2c9e971d6f77a7d6c7c78e6f9b7b18d
Please reload this pagehttps://github.com/simstudioai/sim/pull/5248/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5248/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.