Skip to content

v0.4.0 — the backup yard, and dirty pages stop being free

Latest

Choose a tag to compare

@mariuz mariuz released this 30 Jul 11:21

Ports the applicable parts of PGSimCity v0.10.1 through v0.19.0.

Added — the backup yard (from PG's v0.18.0 pgBackRest work, rebuilt around Firebird's actual tools)

  • gbak Depot — a logical backup that runs online, and whose snapshot transaction pins the OIT for its entire run. Start one against a busy city and watch garbage collection stall and the version towers climb until it finishes: the reason a nightly backup and a mysteriously bloating database are so often the same story.
  • nbackup Vault — physical backup by level. Level 0 copies the whole file, level 1 only the pages changed since level 0. The chain is enforced: level 1 without a level 0 is refused, and Restore chain reports the levels a restore would apply, in order.
  • The Difference File — a new pit beside the main excavation. Locking the database (nbackup -L) freezes the main file and every page write diverts into the delta, which fills visibly and merges back on unlock. Leave it locked and it grows for as long as you watch — a real Firebird operations failure mode, now shareable with ?lock=1.
  • Two scenarios: Nightly gbak on a busy DB and nbackup with delta.

Fixed — dirty buffer eviction was free (from PG's v0.16.0)

Evicting a dirty page cost nothing, which quietly understated write pressure. A dirty eviction now writes the page out first, so a reader pays for someone else's write. Commits flush their page under forced writes (Firebird's default), so dirty evictions stay rare on a healthy database (~1%) and only bite when the cache is too small for the working set (~5% at 16 buffers) — which is the honest lesson, and the new evictions (dirty N) readout shows it.

Added — walk-up controls (from PG's v0.17.0 autovacuum lever)

The controls that belong to a subsystem now live on the subsystem: the Sweep & GC Depot can start a sweep or switch automatic sweep off, the nbackup Vault runs levels and toggles the lock, the Difference File offers "unlock & merge", and the Transaction Hall lets you forget to commit a transaction — all from the building's own panel.

Added — docs/KNOBS.md, a knob audit (from PG's v0.13.0)

Every control and readout, what it does to the model, and whether the mechanism is real, merely scaled, or a plausible modeled stand-in — followed by the deliberate simplifications, written down so nobody has to discover them by reading sim.js.

Fixed — screenshot driver leaked browser profiles (from PG's v0.19.0)

tools/screenshot.ps1 never passed --user-data-dir, so every run grew a shared default profile with caches and crash dumps. It now uses a throwaway profile and deletes it in a finally block.

Fixed — iOS Safari page zoom (from PG's v0.14.0)

Focusing a form control under 16px makes iOS Safari zoom the whole page. Controls are now 16px on phone widths.

Changed

  • The control room grew a Backup yard section; its heading now hides correctly when the panel is collapsed.
  • Stats bar gained dirty evictions, backup state and delta size.
  • README documents the camera honestly (there is no rotation — it is a fixed isometric projection) and links the knob audit.

Deliberately not ported

PG's environment lighting, GTAO, shadow maps, collision detection and walk-mode levers are 3D-renderer features with no meaning on a 2D canvas. Their PGlite-backed real SQL parsing is a different project's premise — FBSimCity stays a model, and KNOBS.md now says so in detail.