gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit593a6350593a6350boot: resumable start-up scan, the server listens first (T17)mre593a6350/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

  • 593a6350boot: resumable start-up scan, the server listens first (T17)mre
  • be4890a0reports: H2 hydration audit (no test change needed)mre
  • 1f9c8bf4re-vendor Hybriel 5406d146 (hl:web batches 9+10: #72 emits while the socket is closed delivered after reconnect, browser boot linear, faster list appends; contains int 6–14 + m406)mre
  • c1df88eddocker-compose: HL_GC_TABLE_LOAD=62 (tracker mission 048, T16 real-data numbers)mre
  • d0a82867mission 048: report, LOG (HL_GC_TABLE_LOAD=62 measured)mre
  • 2d4be66fre-vendor Hybriel 5df4eb7e (GC: HL_GC_TABLE_LOAD knob, mission 406)mre
  • 99e7c8b9tests: realdata-m035-radii, repro-t38, realdata-060-backfill ports from env (REAL_PORT, REAL_CHROME, REPRO_CHROME), defaults unchangedmre
  • 4625aa22re-vendor Hybriel 6f8a0689 (int 6–11: streaming cursors, #203 index heal + close() fix, fd403 listDir/cursor fds, hl:time browser side, hl:web batches 5+6)mre
  • a6dfd6ecdeploy: person-lookup gate (tracker#46)mre
  • 33ad4bd5Merge commit 'f57f64f'mre
  • 7d38cec4docker-compose: nofile 65536 (default soft 1024 refused boot: errno 24 in fs.listDir, Hybriel 528bc89f)mre
  • f57f64f0mission 046: report, LOGmre
  • 5965963adeploy: backup copies index files first and *.mpack data last (hot-copy skew, hybriel #203)mre
  • efe1b485mission 046: re-vendor Hybriel master 60b2817b (integration 8, #203): plugins mpackdb + web (bin/ git-ignored: hybriel, libhlrt.a, hlc.o, hlrt/ from native/zig-out)mre
  • 53099ffbmission 046: person page reads a slim per-title credit row cache (no whole-record fetch per credit); gate tests/person-lookup.mjsmre
  • 9b3828aemission 046a: report, LOGmre
  • 4b37356emission 046: franchise seed supersedeCollections reads the curated timelines once (10 s one-tick block at the end of boot)mre
  • ac6268e3mission 046a: re-vendor Hybriel 528bc89f (integration 6): plugins mpackdb/time/web (bin/ git-ignored)mre
  • 322b3293mission 046: photoQueue guard for non-row fetch results (damaged persons index)mre
  • e5b99aecmission 046: photoQueue in slices (people.hl photoQueueStart/Step, jobs.hl photoTick), tests/photoqueue.hlmre