gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitc7cdef62c7cdef62Log: Apollo STOP, workers pausedmrec7cdef62/missions/044-jobs-slices.md

2.5 KB

  1. # 044 — the background jobs run in slices (tracker.worldapi.org ticket 45, part 2 of the trkmem fix)
  2. Cause (Hybriel mission 388, trkmem): after the server listens, the background jobs rescan whole tables with `find(null, null)`
  3. (merge 74 s, adult backfill 28.5 s, details repair 19.3 s …): every scan decodes ALL rows into one array and the single-threaded
  4. server serves no page meanwhile (loads of 19–28 s).
  5. Finding while doing it: `iterate(null, null)` is NOT streaming either — plugins/mpackdb/mpackdb.zig `find_all` reads and decodes the
  6. whole file into one native arena in ONE call (then hands rows out one by one). So "stream instead of find" would still block for
  7. the whole decode. The slice therefore has to be a different query: a primary-key RANGE (`range('id', from, to)`, engine
  8. `findRangeLocs`: searches the in-RAM pk index, reads only that range's rows).
  9. Work (branch w44-jobs-slices, Hybriel only, no plugin edit):
  10. 1. lib/slices.hl: 256 slices by the first two hex digits of the id (ids are 16 hex chars; the bounds are inclusive, a row whose key
  11. equals the upper bound is left to the next slice, so the slices partition ANY key set exactly); `collectStart/collectStep/collected`
  12. collect only the ids a job needs, taking slices until `TRACKER_SLICE_MS` (30 ms) is spent per timer tick.
  13. 2. adult / kind / tvmaze-status / art / credits / details-repair queues (backfill.hl, credits.hl, details.hl + jobs.hl ticks): scan by
  14. slices on the 0.1 s tick; the start log line now reads "(N ms to find them, M ms of scanning in slices)".
  15. 3. merge prepare (merge.hl): a phase machine over shows → watches → seasons → episodes → follows → persons, same maps/queue, the working
  16. maps released at the end; `mergePrepare()` answers false until built (jobs.hl mergeTick, mergeStep).
  17. 4. collections prepare (collections.hl `seedPrepare`): checks table and shows by slices (timelines: a few hundred rows, one `find`).
  18. 5. check: tests/jobs-dump.hl (new) + the old tree's twin through the former functions, on tests/seed-bulk.hl (≈2.9 K shows spread over
  19. all slices, duplicate groups, strays, doubled episodes, 3 non-hex ids): sorted outputs equal incl. every table after all merge steps.
  20. 6. tests/slices-bench.hl: longest tick of a sliced scan vs the one block of the old scan on a big store.
  21. 7. The 5 gates + check-theme.
  22. Not changed (other owner / small): lib/people.hl photoQueue (boot-path file of worker T9: 621 K `personsTable.fetch` in ONE tick —
  23. see the report), follows/watches/franchises/timelines scans (small tables, user tables), dailysync.hl moveCopiedSummaries (runs once ever).

Branches

Latest commits

  • c7cdef62Log: Apollo STOP, workers pausedmre
  • d0c083fbLog: usage stopmre
  • c6d464e5Log: Apollo GO backlog, AP56 and BS1 startedmre
  • 1eb6f1a1Missions AP56, BS1mre
  • 4871f8adLog: AP52 live on day52, browser gate greenmre
  • d9bf2988Merge ap52: day52, tracker#58 server argument, #51 modal close rule, #56 keyed season rowsmre
  • c4a60ef2Log: RT52 retest passed, AP52 startedmre
  • 83760a55Browser gate: search results belong to the address form of the typed text (tracker#52 navigate replace)mre
  • 6e951d91AP52: show-page rows are keyed records; closing a season is one upsert and removes (tracker#56, hybriel#331)mre
  • 3bb4ccddAP52: modal close button refers to its nested rule with Style.buttonModalX (tracker#51, hybriel#333)mre
  • ba16933fAP52: login callback and title route are static handlers taking the server as third argument (tracker#58, hybriel#332)mre
  • 85153900AP52: re-vendor Hybriel set day52 (source 77cfca31, bin 0a8ed496)mre
  • 7c051eddLog: hybriel#338 answermre
  • d049b8b8Log: HM50 live, #52 donemre
  • 6d05fa37Log: HM50 Part A mergedmre
  • 1c7dab74HM50: the shell reads the framework's online state, netProbe removed (tracker#55)mre
  • e8b91697HM50: search address follows the text via navigate(path, replace = true) (tracker#52)mre
  • 6fe1896cHM50: re-vendor Hybriel set day50 (source 0ae38232, bin d3ef9d16)mre
  • 2f391aa9Log: HM50 startedmre
  • 4b59c03dHM50 mission: doc pathmre