gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit8e6aa91d8e6aa91dlog: GC1 deploy retrymre8e6aa91d/tools/old-short-ids.hl

1.7 KB

  1. // tools/old-short-ids.hl — mission 060 (tracker.worldapi.org#27), one-off: the old tracker's short ids → data/old-short-ids.json.
  2. // The old export's Show.jsonl carries `id` (5 characters, base62 counter '100jh'…) on 702 of 9,453 shows; the file maps the
  3. // old Mongo `_id` (= our shows' `oldId`, tools/migrate.hl) → that id. shortids.hl reads it at start and gives those shows
  4. // their old id back. Reads only the export (never storage/); the export is on Loreana only, the JSON file goes with the code.
  5. //
  6. // TRACKER_OLD_DATA=/media/STORAGE/projects/old-tracker/mongo-export TRACKER_MIGRATE_TMP=$PWD/.scratch/old-short-ids-tmp \
  7. // TRACKER_OLD_SHORT_IDS=$PWD/data/old-short-ids.json ./bin/hybriel tools/old-short-ids.hl
  8. import { env } from 'hl:proc'
  9. import { writeFile } from 'hl:fs'
  10. import { oidOf, bigLinesOf } from '../lib/export.hl'
  11. oldDir = env('TRACKER_OLD_DATA')
  12. tmpDir = env('TRACKER_MIGRATE_TMP')
  13. outFile = env('TRACKER_OLD_SHORT_IDS')
  14. if (oldDir == null || !oldDir.startsWith('/') || tmpDir == null || !tmpDir.startsWith('/') || outFile == null || !outFile.startsWith('/')) {
  15. hlError('set TRACKER_OLD_DATA (the mongo-export directory), TRACKER_MIGRATE_TMP (a scratch directory) and TRACKER_OLD_SHORT_IDS (the JSON file to write), all ABSOLUTE')
  16. }
  17. // hl:fs readFile stops at 10 MiB (lib/export.hl): Show.jsonl (12.4 MB) is cut into chunks first, like migrate.hl does
  18. shows = 0
  19. found = {}
  20. count = 0
  21. for (l of bigLinesOf(oldDir + '/Show.jsonl', tmpDir + '/show', 5000)) {
  22. let d = JSON.parse(l)
  23. shows = shows + 1
  24. if (d.id != null && hlTypeName(d.id) == 'String' && d.id != '') {
  25. found[oidOf(&d._id)] = d.id
  26. count = count + 1
  27. }
  28. }
  29. writeFile(outFile, JSON.stringify(found), 420)
  30. print('shows=' + shows + ' withShortId=' + count + ' → ' + outFile)

Branches

Latest commits

  • 8e6aa91dlog: GC1 deploy retrymre
  • 87ad2dc1log: GC1 deployingmre
  • 53f10fb8Merge branch 'gc1-deploy'mre
  • 7fcbf1d2log: GC1 deploy GOmre
  • 1fb6664bcompose: TRACKER_QSTATS=1 (GC1 measurement)mre
  • 6576c1cdgc1: release the people-view scan lists once the view is builtmre
  • 94f8a373gc1: back out the kept episode-id set (no measurable gain on /my/unwatched: 4.69 -> 4.61 GB per 150 loads)mre
  • a1a88bd4gc1: search skips the stale-key string while no entry is stale; /my/unwatched asks a kept id set instead of building a key string per episode rowmre
  • cd830744gc1: dbSearch: no split / map / list copy per candidate (scores from the stored text, top list touched only when the hit can enter)mre
  • 451db7cdgc1: show page and check clicks read the kept watched set instead of building one from a by-value copy of every watchmre
  • ddb4127egc1: TRACKER_QSTATS=1 logs queue and cache sizes every 10 s (measurement only)mre
  • da60547fstatus: GC1 done, backup bugmre
  • e4171021log: GC1 result, backup hard-link bugmre
  • f1597214deploy.sh backup: tar --hard-dereference (hot tar stored mpackdb sidecars as hard links to .sessions files)mre
  • 6b58571elog: GC windowmre
  • 5c8baa1fdeploy lock: hold only around deploy.shmre
  • b8dac822log: hybriel#309mre
  • bf676d9elog: GC1 startedmre
  • c7828541mission GC1mre
  • ef949994conductor: neutral ticket rulemre