Skip to content

Replicated erasure tests provision their lease table - #1076

Merged
zlareb1 merged 1 commit into
mainfrom
fix/replicated-clear-lease-fixture
Nov 20, 2026
Merged

zlareb1 merged 1 commit into
mainfrom
fix/replicated-clear-lease-fixture

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Related: #1070

Changelog category (leave one):

  • CI Fix or Improvement

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

None; integration fixture setup only.

Why

Replicated erasure tests copy the tables they exercise into a private database. Memory clearing also takes write leases in that database, but the fixture omits _migration_lock. Both clear tests fail with UNKNOWN_TABLE before checking their mutation results. The same failures occur on main.

Scope and risk

Create the fixture's lease table from the bootstrap schema, using a KeeperMap path unique to the fixture database. Keep the existing assertion that all copied data tables use replicated engines. The fixture database cleanup removes the coordination table with the data tables.

Compatibility, rollout and rollback

  • Wire: none.
  • Operator steps: none; the change affects test setup.
  • Rollback: revert the fixture addition. No production rows or migrations change.

Tests

  • On clean main, pytest tests/integration/test_erasure_replicated_ch.py -q against a private ClickHouse with embedded Keeper reproduces two failures and three passes.
  • With the fixture table provisioned, the same command passes all five tests, including the clear that preserves locked rows across mutation batches.
  • pytest tests/unit/test_integration_suite_targets.py -q: 354 passed.
  • Unit shard 3 passes on one rerun after its worker exits with SIGSEGV during translation validation. The isolated translation check also passes locally.
  • make format-check, make lint, make typecheck pass. The broader local unit suite has existing ClickHouse-local and parser limitations; CI runs the full suite.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated: Codex wrote the fixture setup and verified the reproduction and all existing assertions against a private ClickHouse.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • Format, lint, type, unit, coverage and integration gates pass in CI; the local checks and limitations are listed above.
  • No generated files require changes.
  • No migrations are added or changed.
  • No coding-agent plugin files change.
  • No frontend files change.
  • No operator steps or wire changes.
  • Repository text passes the public-copy checks.
  • Commits are signed off.

Memory clearing takes write fences in the fixture database. Provision its KeeperMap lease table with an isolated path so the replicated mutation assertions can run.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loom-docs Ready Ready Preview Nov 20, 2026 9:41pm UTC

Request Review

@zlareb1
zlareb1 merged commit 47318f3 into main Nov 20, 2026
88 of 89 checks passed
@zlareb1
zlareb1 deleted the fix/replicated-clear-lease-fixture branch November 20, 2026 22:45
This was referenced Nov 20, 2026
zlareb1 added a commit that referenced this pull request Nov 21, 2026
Related: #455, #1076, #1077

### Changelog category

- Improvement

### Changelog entry

The Postgres authority stores memory heads and revision payloads without fields at their default values, reducing repeated JSON fields while preserving the rows returned to callers.

### Why

Most memory fields hold their defaults. Repeating their names and values in every stored JSON row costs space. Sparse-row readers shipped in v1.2.0 and v1.3.0, so the writer can omit those fields in a later release.

### Scope and risk

`commit_versions` builds the stored form before taking transaction locks and uses it for head and revision JSON. Full encoded rows still supply identity, admission, audit metadata, delivery targets and returned rows. Only fields in `FIRST_VERSION_DEFAULTS` may be omitted. Identity, content, provenance, version, hashes, required timestamps, memory type and confidence stay stored.

The Cell verifier decodes both stored rows before comparing them. Its value, vector, audit, delivery and failure checks remain. Existing usage and redaction updates may store explicit defaults; readers accept either form. The shared replicated-erasure fixture repairs are already on `main`.

### Compatibility, rollout and rollback

- Wire and operator steps: none.
- Deploy beside builds that read sparse rows; released v1.2.0 and v1.3.0 contain those readers.
- A sparse-capable released build reads existing rows after rollback. Reverting the writer requires no rewrite.
- No table, migration, setting, worker or generated-file change is needed.

### Tests

- All five hosted workflows pass on the published head: CI, Docker smoke, CodeQL, plugin scanner and docs. The rollup has 54 successful checks and two expected publication skips. This includes Postgres 16/18 authority, all integration shards, isolation, mixed-version, unit coverage and Cell acceptance.
- The authority integration checks actual sparse head/revision storage, full/sparse point-read equality, list/search/bulk reads, revisions, cross-session defaults, usage and erasure export.
- The verifier regression runs both representations through all original fault cases and assertions. Earlier focused validation produced two sparse failures before the repair and 32 passing cases after it; six related authority cases also passed.
- Scoped Ruff lint/format and the public prose check pass. Local composition test attempts were refused before execution by the resource guard and remain unrun; final-head behavior is qualified by hosted CI.

### AI assistance in the code

- AI-generated: Codex wrote the sparse writer and verifier regression. Independent source reviews checked the full change, published description, released-reader compatibility and current-main composition.
- [x] I can explain every line of this diff and how it interacts with the rest of Loom.

### Checklist

- [x] Required hosted format, lint, type, unit, coverage and integration gates pass on the published head.
- [x] No generated files or migrations change.
- [x] No plugin or frontend behavior changes.
- [x] Architecture documentation describes sparse storage and in-place updates.
- [x] Public text contains no deployment details.
- [x] Commits are signed off.

Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
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