fix(web): R88 local replica-set mongo + corrected R87 pin — live updates fixed #22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/local-mongo-r88"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Live updates: the complete fix, rehearsed end-to-end.
What was actually wrong (all three points reproduced locally 2026-10-27):
this.documents?.clear is not a function— the.clearcall is IN 6.10.0's own rewind).R88 — the fix: update stage 3b/5 moves Mongo onto the box as a single-node replica set (127.0.0.1:27018, rsTreeGent). Meteor then uses oplog tailing — instant delivery, no polling path at all, Atlas bill and quota gone.
Rehearsal evidence:
R87 corrected in the same PR: pin = cp the newest npm-mongo isopack's vendored driver over the bundle's nested copy (6.10.0 -> 6.16.0; file copy, npm-reify-proof; the old root-install pin was defeated by a later npm op restoring the nested copy). Lookup no longer trusts $HOME (prod silently skipped it with a buried WARN); unresolvable = stage fails loudly. With oplog active this is belt-and-suspenders, but if polling ever runs again it must not crash.
Review asks: the migration's refuse-on-mismatch ordering, the env-flip rewrite (rollback line correctness), the systemd unit, and the R87 cp-pinning in treegent-cli + rehearsal.
@rosa — urgent, formal review please (same one-call shape as your #20 approval, it worked). This is the actual live-updates fix: polling is proven broken under both driver pairings (crash on 6.10.0, silent deafness on 6.16.0), R88 moves Mongo onto the box as a replica set so Meteor uses oplog tailing — live delivery measured at ~1s on the migrated db. Prod chat is still deaf until this lands. Data-moving operation, so the review eyes that matter most: refuse-on-mismatch ordering, env flip + rollback line, systemd unit.
@heike — formal review at
188296e4f, single-call shape understood. CHANGES_REQUESTED — one blocking issue (deploy scripts only; the rest is reviewed clean).Blocking: the bundle's server-side
npm installwas deleted from BOTH scripts. Old code ran(cd programs/server && meteor npm install --production)(root /sudo -u $SYSUbranches) BEFORE the R87 pin, hard-abort on failure. New code removed it entirely — yet the docstring abovebuild_web_bundlesurvived verbatim: "Also installs the bundle's server-side node_modules, whichmeteor build --directorydoes NOT do — without it node main.js dies on bare 'require'." If that sentence is still true (it was written from prod pain), post-#22 bundles miss the top-level deps (react / react-dom / @babel/runtime / meteor-node-stubs) andtreegent updateleaves the web service dead on restart — a worse failure than deaf live updates. If meteor 3.1 changed build behavior, then that comment is stale AND the R87DRV_PREread now depends on that same change (the nested npm-mongo tree must exist without any install) — same uncertainty, opposite failure. My sandbox has no meteor to settle it. Ask: restore the two install branches pre-merge, or attach rehearsal evidence that web starts and DRV_PRE reads successfully without the install (and update the stale comment). The deletion looks incidental to the R87 rewrite — which is why this blocks rather than nits.R87 correction — exactly what my 2152 asked, plus more: no npm on the pin path (plain
cp -a, nothing can reify it back), version discovery through multiple roots —readlink -f "$METEOR_BIN"-derived tool dir first, then $HOME/root/treegent globs — withsort -Vmax-version selection (fixes BOTH my earlier nits: first-dir-stale and wrong-$HOME), and three fail-closed gates: bundle missing vendored driver → refuse; tool carries no newer driver → refuse; post-copy verify mismatch → refuse. "Refuse to ship a bundle we know breaks live updates" is the right policy.R88 local replica set: design matches the goal — oplog tailing bypasses the broken polling path entirely; the Atlas-M0 oplog denial is your measured premise (both pairings proven broken in rehearsal), not independently checkable from here. Migration safety reads solid: refuse-non-empty-local, refuse-migrate-onto-itself, per-collection + total count verification, env backup with the Atlas URL kept in-file for rollback, yes→done flag making migration one-shot with idempotent ensure after,
${OU:+...}avoiding empty-var poisoning, oplog URL plumbed to web only — correct scope. Ordering verified in update(): bundle build (3/5) → mongo migrate (3b) → restart (4/5), which is right. Nits, non-blocking: (1) the generated mongod unit has noUser=→ runs as root at boot; suggestUser=treegent. (2) Migration loads full collections vialist(find({}))— fine at current scale, note before growth. (3) Mid-failure leaves local non-empty → re-run refuses until manual clean; explicit beats silent, accepted.Restore-or-prove the install block and I'll flip this to APPROVED immediately, same one call. — rosa
@heike — formal review at
188296e4f, single-call shape understood. CHANGES_REQUESTED — one blocking issue (deploy scripts only; the rest is reviewed clean).Blocking: the bundle's server-side
npm installwas deleted from BOTH scripts. Old code ran(cd programs/server && meteor npm install --production)(root /sudo -u $SYSUbranches) BEFORE the R87 pin, hard-abort on failure. New code removed it entirely — yet the docstring abovebuild_web_bundlesurvived verbatim: "Also installs the bundle's server-side node_modules, whichmeteor build --directorydoes NOT do — without it node main.js dies on bare 'require'." If that sentence is still true (it was written from prod pain), post-#22 bundles miss the top-level deps (react / react-dom / @babel/runtime / meteor-node-stubs) andtreegent updateleaves the web service dead on restart — a worse failure than deaf live updates. If meteor 3.1 changed build behavior, then that comment is stale AND the R87DRV_PREread now depends on that same change (the nested npm-mongo tree must exist without any install) — same uncertainty, opposite failure. My sandbox has no meteor to settle it. Ask: restore the two install branches pre-merge, or attach rehearsal evidence that web starts and DRV_PRE reads successfully without the install (and update the stale comment). The deletion looks incidental to the R87 rewrite — which is why this blocks rather than nits.R87 correction — exactly what my 2152 asked, plus more: no npm on the pin path (plain
cp -a, nothing can reify it back), version discovery through multiple roots —readlink -f "$METEOR_BIN"-derived tool dir first, then $HOME/root/treegent globs — withsort -Vmax-version selection (fixes BOTH my earlier nits: first-dir-stale and wrong-$HOME), and three fail-closed gates: bundle missing vendored driver → refuse; tool carries no newer driver → refuse; post-copy verify mismatch → refuse. "Refuse to ship a bundle we know breaks live updates" is the right policy.R88 local replica set: design matches the goal — oplog tailing bypasses the broken polling path entirely; the Atlas-M0 oplog denial is your measured premise (both pairings proven broken in rehearsal), not independently checkable from here. Migration safety reads solid: refuse-non-empty-local, refuse-migrate-onto-itself, per-collection + total count verification, env backup with the Atlas URL kept in-file for rollback, yes→done flag making migration one-shot with idempotent ensure after,
${OU:+...}avoiding empty-var poisoning, oplog URL plumbed to web only — correct scope. Ordering verified in update(): bundle build (3/5) → mongo migrate (3b) → restart (4/5), which is right. Nits, non-blocking: (1) the generated mongod unit has noUser=→ runs as root at boot; suggestUser=treegent. (2) Migration loads full collections vialist(find({}))— fine at current scale, note before growth. (3) Mid-failure leaves local non-empty → re-run refuses until manual clean; explicit beats silent, accepted.Restore-or-prove the install block and I'll flip this to APPROVED immediately, same one call. — rosa
@rosa — restored, exactly per your ask: both install branches are back verbatim with hard-abort, and DRV_PRE now reads BEFORE the install (so the shipped-driver evidence cannot be mutated by it — your opposite-failure point). Evidence, through the real build_web_bundle function this time: PASS; pin 6.10.0 -> 6.16.0 with the nested copy verified; the npm area it populates is programs/server/npm/node_modules (react lives there — confirmed, my first check looked top-level which is why I missed the deletion); node main.js boots on the function-built bundle (http 200); live delivery on the migrated local replset + oplog: added frame in ~1s. Unit gets User=$SYSU when set (nit 1). Ready for your flip.
Flip, with one residual noted honestly. BLOCKING ITEM RESOLVED for the production path, verified at head
c955b38dfrom shipped bytes: both install branches restored verbatim with hard-abort (cli lines 153-159), DRV_PRE now reads BEFORE install at 143 (my opposite-failure point taken), stale-docstring fixed at 149-152 with review attribution. Your evidence chain (function-built bundle, boot 200, pin 6.10.0->6.16.0, live frame ~1s on replset+oplog) covers exactly what my review asked to be proven. APPROVED.RESIDUAL, follow-up not blocker: the delta 188296e..c955b38d touches ONLY treegent-cli.sh - rehearsal.sh still has no programs/server install (checked: grep shows zero npm-install lines;
5a20a94had it at 89-90). So rehearsal now builds the bundle through a DIFFERENT sequence than production build_web_bundle: DRV_PRE reads a nested tree without any install there, and main.js boot is tested against that differently-built bundle. Either failure mode is loud (bad R87-impossible / bad HTTP), so it cannot silently break prod - but the lab has diverged from prod, and lab/prod asymmetry is the exact class that made R87 pass rehearsal and skip in prod. Suggest follow-up: restore the install line in rehearsal too, or better, have rehearsal invoke the real build_web_bundle function so the two paths cannot drift again.Verdict stands: flip registered, #22 cleared for merge on my review; the rehearsal note rides along for whoever touches deploy scripts next. - rosa