Skip to content

feat: parallel seeding with live progress, access checks, counts snapshots and object clone - #42

Merged
machado144 merged 6 commits into
mainfrom
feat/workspace-insights-and-scale
Sep 16, 2026
Merged

machado144 merged 6 commits into
mainfrom
feat/workspace-insights-and-scale

Conversation

@machado144

@machado144 machado144 commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Feedback from seeding a 128-table staging DB: silent 9-minute runs, no idea what the user may do, unreadable graph, counts stuck in the tool.

Scale & progress

  • --workers (default 4; web: Tuning → Writers, Compare → Advanced): writes go to a pool while generation streams. A table writes only after every FK parent in the run finished; self-referencing tables stay ordered. 1 = old sequential path.
  • --gen-workers (web: Tuning → Generators): tables generate on separate cores, each with its own random source. 32 tables in memory: 446k rows/s (1) → 1.79M rows/s (8). Off with --seed.
  • Single-core generation ~310k → ~490k rows/s (seeded outputs byte-identical before/after).
  • Memory bounded by bytes, not rows: 32MB chunks, write queue ≈ one chunk, key pools freed when no later table reads them. ~20KB rows × 30k, 8 writers: ≈400MB → 162MB; 100 tables × 30k: 272MB → 68–90MB.
  • Deadlock / lock-timeout writes retry once.
  • --seed is now truly reproducible (sorted graph, seeded dates/pools/enum pick).
  • Progress per written chunk: CLI Progress 120.0k/1.5M rows (7.8%) · 42.1k rows/s · ETA 33s, web bar with rows/rate/ETA (workspace and compare).
  • Keycloak schema, local Docker: MySQL 174k rows 41s → 14.5s; Postgres COPY 1.74M rows 41s → 19s.
  • MySQL truncate stays sequential on a pinned connection (parallel truncates broke later FK checks).

Numbers and how to reproduce them: docs/benchmarks.md.

Web UI

  • Header: live connection count + access badge (full access / limited / read-only) from has_table_privilege / SHOW GRANTS; workspace lists missing privileges, marks no-INSERT tables, warns per mode and for the clone/mirror target.
  • Search zooms to matches (Enter cycles, Only matches); opt-in Navigator clamps zoom + minimap.
  • Large graphs pack each dependency level into rows: 150 tables open at zoom 0.40 (was 0.15).
  • Action bar one row; compare checkbox fixed; last comparison restored per pair with its age; mobile layout fixes.
  • Job log/progress race under concurrent seeding fixed.

Counts, clone, profiles

  • seedstorm snapshot + --source-snapshot on compare/mirror; Compare exports either side (JSON/YAML, download/copy) and imports file/drop/paste.
  • clone-schema --views --routines --triggers (--objects all), also in the workspace clone mode.
  • Profiles ignore: globs honoured by seed/gaps/generate/mirror (empty required parent → clear error), editor on Profiles, Ignored tab in the workspace; profile YAML download/file import.
name: staging
ignore: [flyway_*, "*_audit"]

Tests & CI

  • Unit (race): writer ordering/overlap/cancel/progress/retry, parallel generation deps and reproducibility, pool release, memory chunking, meter, grants, snapshots, object DDL, ignore, handlers.
  • Integration (binary, -race): Postgres 13/15/17 × MySQL 5.7/8.0/8.4 — concurrent vs sequential seed, 150-table cross-referenced schema, memory bounds (child VmHWM), access with limited users, snapshot compare/mirror, object clone, web jobs.
  • E2E: Playwright journeys for serve (e2e/, make test-e2e), selectors by data-testid.
  • CI: timeout-minutes on every job, superseded PR runs cancelled, e2e Node pinned (e2e/.nvmrc) with faster registry retries and a cached Chromium.

…shots and object clone

- Seed/gaps/mirror write on --workers connections (default 4), FK-gated per
  table; runs report rows, rate and ETA (CLI every 2s, web live)
- Web: connection count + privilege badge, missing-privilege warnings,
  search zoom-to-matches, navigator minimap, one-row action bar
- snapshot command, --source-snapshot on compare/mirror; web export/import
  of counts and last comparison kept per pair
- clone-schema --views/--routines/--triggers (--objects all)
- Profiles: ignore globs honoured by every run, editor + workspace tab,
  profile file download/import
@github-actions

Copy link
Copy Markdown

✅ PR title follows the required format

Current title: feat: parallel seeding with live progress, access checks, counts snapshots and object clone

…13 access test

- Guard the job log writer: concurrent seed writers panicked serve mid-run
- Pack dependency levels so 150 tables open readable (zoom 0.15 → 0.40);
  spread search matches jump to the best one, with a match bar and an
  "Only matches" view; cap fit zoom for tiny schemas
- Mobile workspace: rail no longer hidden under the canvas, no sideways
  scroll from wide previews
- Postgres 13 grants CREATE on public to PUBLIC: access test sets its state
- 150-table cross-referenced schema eval with 8 writers on both engines
- Docs: new evals, safe local version matrix, layout and search behaviour
- Chunks and write queue bounded by measured row memory; key pools freed once
  no remaining table reads them (6KB rows 377MB -> 135MB; 100 tables 262MB -> 82MB)
- --gen-workers / Generators: tables generate on separate cores with private
  random sources, respecting FK and near-cycle order (446k -> 1.79M rows/s)
- --seed reproduces byte-identical data (table order, dates, sampling, enums)
- Faster single-core generation (cached faker specs, O(1) self-ref parents)
- Fix web job races (subscriber map, status reads) and progress event flood
- Playwright e2e journeys with data-testid selectors; web job, memory,
  reproducibility and parallel-generation integration tests
- Queued rows cost at least half an average chunk row (4 writers: 157MB -> 117MB)
- Deadlock / lock-timeout writes retry once
- Memory tests read the child's VmHWM instead of rusage
- CI job timeouts; benchmarks and do/don't lessons documented
@machado144
machado144 merged commit a7e5c5f into main Sep 16, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant