Title: fix(file-search): claim a file write that lands on an owner the backfill already queued by waleedlatif1 · Pull Request #9666 · simstudioai/sim · GitHub
Open Graph Title: fix(file-search): claim a file write that lands on an owner the backfill already queued by waleedlatif1 · Pull Request #9666 · simstudioai/sim
X Title: fix(file-search): claim a file write that lands on an owner the backfill already queued by waleedlatif1 · Pull Request #9666 · simstudioai/sim
Description: Summary Follow-up to #9655, from review on the release PR. Backfill reconciliation wake-ups enter the owner queue as if just dispatched, so they rotate in behind owners woken for a write. A file write that landed while such a row was still queued only advanced its updated_at (the file trigger's ON CONFLICT upsert), so it kept the reconciliation stamp and waited behind every older-stamped owner — during a long walk, several passes. The same held for an owner that was served, left queued with work, and then woken again. Claims now take owners woken since their last dispatch first: never dispatched, or updated_at > last_dispatched_at (wokenSinceDispatch). Every real wake-up advances updated_at (file write, released claim, reaped claim, artifact-ready requeue); a reconciliation wake-up never does — it now uses ON CONFLICT DO NOTHING, so it leaves an already queued owner untouched. Within each group the dispatch-age rotation is unchanged, so fairness is unchanged. The two compared columns come from one clock: the dispatcher and artifact-ready write them with the transaction's now(), as the trigger does. The remaining window is a write whose transaction began before the claim that stamped its owner; it waits one rotation by dispatch age (documented on wokenSinceDispatch). No migration, no trigger change, caps unchanged. The claim's queue select no longer follows file_search_dispatch_schedule_idx and sorts the queue instead (hundreds to low thousands of narrow rows, once a minute, row locks still only on returned rows). Type of Change Bug fix Testing dispatcher.integration.ts (real PostgreSQL, writes through the real workspace_file_search_mark_pending trigger): serves a file write to %s ahead of a backfill page of reconciliation wake-ups — now table-driven; the new "owner the page left queued" case is red on the old code and without the wokenSinceDispatch ordering keeps a queued reconciliation wake-up behind woken work when the backfill passes it again — red on the old code, without the ordering, and on a mutant whose reconciliation upsert bumps updated_at leaveSlots helper replaces three copies of the capacity setup Suite 39/39; also owners.integration 18/18, chunks.integration 49/49 (1 opt-in skip), index-plan.integration 9/9, content-rendered.integration 31/31, lib/workspace-files/search unit tests 178/178 lint and type-check (pre-push hooks); remaining audits in CI Note: dispatch work check > reports work for a backfill reconcile that is due compares a DB-clock completed_at against a JS Date exactly at the reconcile threshold and can flake by milliseconds; untouched here Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing (new tests pass the test-audit authoring gate) 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 Follow-up to #9655, from review on the release PR. Backfill reconciliation wake-ups enter the owner queue as if just dispatched, so they rotate in behind owners woken for a write. A file w...
X Description: Summary Follow-up to #9655, from review on the release PR. Backfill reconciliation wake-ups enter the owner queue as if just dispatched, so they rotate in behind owners woken for a write. A file w...
Opengraph URL: https://github.com/simstudioai/sim/pull/9666
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,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-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:592e820a-e52f-b3a5-1266-1150a524aeca |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DD9C:1172E:1645EB:1FC6EA:6AFB1ED1 |
| html-safe-nonce | cd1b9b5ea9414fa4ed87093805d38ce59977c69d0c0c24141ad7599a854a8dca |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERDlDOjExNzJFOjE2NDVFQjoxRkM2RUE6NkFGQjFFRDEiLCJ2aXNpdG9yX2lkIjoiMzQ0NjMyMzA5MDU3NTUzMTczMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2517407a0c912d9aa035f1b73544dfc2ee4fcac4d1eedc2d753415574612eab0 |
| hovercard-subject-tag | pull_request:5152272724 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/9666/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary Follow-up to #9655, from review on the release PR. Backfill reconciliation wake-ups enter the owner queue as if just dispatched, so they rotate in behind owners woken for a write. A file w... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | f9219899e0d0ce0b87aeba2c640c955f83631457e5baff5df7a36ce599d2635b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | dd3b60f1fd9c5f10a3dcde41ae35682f53e85cee |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width