Compose the named-stage master per object; harden cross-domain catalog pairing#1660
Conversation
… wholesale A named add previously adopted the whole working master root into the staged catalog, dragging unstaged schema changes into the commit: an unstaged ALTER on another table rode along, and an unstaged DROP INDEX destroyed a staged index. The staged master is now composed row by row: table and index rows of the named objects (adds, staged drops, vtab shadows, retired rename names) come from working, everything else keeps the previously staged rows, and views and triggers always keep staged state. Composed rows cross catalog numbering domains, so old-sourced table rows are renumbered to the working table number their aligned entries carry, and the serializer rejects two cross-domain pairings in constructed arrays: an unnamed entry never pairs with a table row, and a named add only pairs with an unnamed staged entry when the staged schema rows identify that entry as the same table. The index schema row comparison shared by status and diff summary moves to a single helper. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Version-Control Performance CeilingsRuns: median of 3 executions per benchmark, excluding fixture setup. The
|
Sysbench-Style Benchmark: Doltlite vs SQLiteIn-MemoryReads
Writes
File-BackedReads
Writes
File-Backed (autocommit)Each statement runs as its own transaction — exposes per-commit ReadsReads have no commit cost; these are the same SQL files as the
Writes
100000 rows, median of 5 invocations per test; autocommit writes use 9, workload-only timing via host monotonic clock when available. Performance Ceiling Check (2.5x individual, 2x average; autocommit writes: 6x / 5x)All tests within ceilings. |
Sysbench-Style Benchmark (composite PK): Doltlite vs SQLiteCompanion to the classic Sysbench-Style Benchmark. Every workload here In-MemoryReads
Writes
File-BackedReads
Writes
File-Backed (autocommit)Each statement runs as its own transaction — exposes per-commit ReadsReads have no commit cost; these are the same SQL files as the
Writes
100000 rows, median of 5 invocations per test; autocommit writes use 9, workload-only timing via host monotonic clock when available. Performance Ceiling Check (2.5x individual, 2x average; autocommit writes: 6x / 5x)All tests within ceilings. |
Sysbench-Style Benchmark (BLOB PK): Doltlite vs SQLiteCompanion to the classic Sysbench-Style Benchmark. Every workload here In-MemoryReads
Writes
File-BackedReads
Writes
File-Backed (autocommit)Each statement runs as its own transaction — exposes per-commit ReadsReads have no commit cost; these are the same SQL files as the
Writes
100000 rows, median of 5 invocations per test; autocommit writes use 9, workload-only timing via host monotonic clock when available. Performance Ceiling Check (2.5x individual, 2x average; autocommit writes: 6x / 5x)All tests within ceilings. |
Sysbench-Style Benchmark (TEXT PK): Doltlite vs SQLiteCompanion to the classic Sysbench-Style Benchmark. Every workload here In-MemoryReads
Writes
File-BackedReads
Writes
File-Backed (autocommit)Each statement runs as its own transaction — exposes per-commit ReadsReads have no commit cost; these are the same SQL files as the
Writes
100000 rows, median of 5 invocations per test; autocommit writes use 9, workload-only timing via host monotonic clock when available. Performance Ceiling Check (2.5x individual, 2x average; autocommit writes: 6x / 5x)All tests within ceilings. |
Follow-ups to #1654/#1656 on named staging with schema objects.
Bugs fixed
Unstaged schema changes leaked into named-add commits. A named
dolt_addadopted the entire working master root as the staged master, so an unstagedALTER TABLE p ADD COLUMNon an untouched table rode into the commit, and an unstagedDROP INDEXdestroyed a staged index. Dolt keeps both out. The staged master is now composed per object: rows for the named objects (adds, staged drops, vtab shadows, retired rename names) come from working; every other table/index row keeps the previously staged state; views and triggers always keep staged state.Cross-domain numbering collisions in the composed master. Composed rows span two catalog numbering domains. Old-sourced table rows are renumbered to the working number their aligned entries carry (mirroring
addAlignStagedEntriesToWorking), otherwise a staged FK child scenario collided numbers,appendMissingSchemaCatalogRowsappended a duplicate row with an empty tbl_name, and the committed catalog was malformed (create_fk_child_stagedcaught this).Serializer pairing hardening for constructed arrays: an unnamed entry (always an index) never pairs with a table row on a bare number match, and a named working table only pairs with an unnamed staged entry when the staged catalog's own schema rows identify that entry as the same table.
Also consolidates the index schema-row comparison shared by status and diff summary into one helper.
Tests
test/doltlite_commit.sh+2 gating tests (unstaged_alter_stays_out,staged_index_survives_unstaged_drop) — both fail before this change and pass after.🤖 Generated with Claude Code