Port the file database now?
opened by Nemesis · assigned to Nemesis
opened · updated
In July the owner started replacing MongoDB with the file database mpackdb. That work is checkpointed on lane 2 but only five of the eighteen database files are converted, and the main branch has moved on by 85 commits since. Finishing it is a big job, probably several days of worker time, and the game must be paused once to copy the data. Decision needed: now, later, or drop.
History
Nemesis opened the ticket imported from nemesis:mpackdb-port
Nemesis assigned the ticket to Caramboleyo Nemesis edited the ticket Subject before:
DECISION: mpackdb migration port onto current masterNemesis changed the state pending Nemesis edited the ticket Subject before:
mpackdb migration port onto current masterSummary before
Lane development-2 feat-mpackdb @ bc1c758 (July WIP checkpointed 10-21). Survey docs/mpackdb-state-2026-10-21.md: 5 files migrated, 13 providers/servers added since still on Mongo (ObjectId->string ids, sector:[x,y] lookups, codes push/pull, buildQueue collection), master 85 commits ahead, no export/import tooling, lane clone = cp -a storage/db with production quiesced. Big topic; needs the user's yes to start the port on a fresh branch from master.
1 comment
Nemesis changed the state open Nemesis assigned the ticket to Nemesis Nemesis changed the state progress 7 comments
Nemesis edited
Edited once
Step 1 of the database switch is done: the branch with the new file database now contains everything from master (two merges, the second one picked up the touch selection and the XR exposure work that landed while I was working). The four conflicting files were resolved so that master's behaviour is kept: the movement fixes, the course race fix, the order refusals, the registration mail and the repair of broken unit sectors. The data access in those files goes through the new file database. The bigger part was not in the conflicts: master had added Mongo use to eleven more server files since July (login, session, planets, system, settlement, tile, units, login codes, population and the build queue). With the old Mongo module gone the server would not even have started, so I ported them too. No server code talks to Mongo any more. Only dead comments, some device test scripts for the other lanes, and the unused mongodb entry in package.json are left. What the check found, on the lane at port 44452 with its own database: all pages load on phone and desktop without errors, logging in with a code works, signing up a new player and colony works (and was cleaned out again), the production queue and worker shares work, unit orders including a second order in mid-flight work, and the command line tool starts. Problems: the lane used an expired certificate (fixed in the lane's own compose file), every restart logs the old port 44444 clash, lock files are only cleaned up after 30 seconds, and the database files grow with every population tick because nothing compacts them. The auditor should look at: moving the real production data from Mongo into the new files (nothing exists for it yet, ids and references change), the fact that every update rewrites the whole record, the check on the unit's course that now relies on the file lock, scans that used to be indexed queries, the world generator (not run here), backups and the production compose file. Details: docs/mpackdb-merge-2026-10-24.md in the lane.
Nemesis Nemesis Nemesis edited
Edited once
Status of the switch. The library problems from the audit are fixed and released as mpackdb 1.0.9 (your own 1.0.8 from 21 October is merged in). Lane 2 now runs on a fresh, converted copy of production's data (17 collections, 1669 records, no problems in the conversion or the integrity check) with the new library: pages, login flow, a colonize round on the phone and on desktop, a unit order and the population tick all work, and the data stays consistent after restarts. The lane keeps running on that copy as a soak; a check script reports pages, tick, integrity, file growth and lock files, and I run it again tomorrow. What remains before the switch itself: the day's soak result, re-merging master into the lane after the next production deploys, and your word for the switch (about ten minutes of downtime; the procedure with rollback is written in development-2/docs/mpackdb-production-checklist.md).
Nemesis edited
Edited once
30 October: the file-database branch now contains everything that is on production (master 5ee1177 merged, commit a473b07). The problem check found one call to MongoDB that the settlement tabs had added and that was never ported (the list of built facilities); it is fixed (16b0175) and proven inside the lane. The lane runs clean on library 1.1.0. Next, as you ordered on 24 October: the thorough audit of the database switch by a Fable worker, then the switch itself only on your word.
Nemesis edited
Edited once
The thorough audit you ordered is done (Fable worker, 30 October; development-2/docs/mpackdb-audit-2026-10-30.md, commit 871f6ea). Verdict: ready for the switch, no code change needed. Three things must happen right before the switch window, not fixes: clean production working tree, a MongoDB dump as backup, one more rehearsal of the switch script on the merged branch. Proven with real taps on the phone and on the desktop: owner facilities tab, build queue add and remove, unit orders, a container restart in the middle with nothing lost. The switch itself waits for your word on ticket 39.
Nemesis
Nemesis edited the ticket Summary before
In July you started replacing MongoDB with the file database mpackdb. That work is checkpointed on lane 2 but only five of the eighteen database files are converted, and the main branch has moved on by 85 commits since. Finishing it is a big job, probably several days of worker time, and the game must be paused once to copy the data. Please answer: now, later, or drop?
2 comments
Nemesis Nemesis
Nemesis changed the state done
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.
Write…