Skip to content
quarry Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 628e48c25309029402d7859bf894bc96832978b4475a027e56050a834017f2b1
Ticket: 0e488373ecc21aca805e5737517dee9994a2a8cb
Schema changes must migrate online, not wipe every index
User & Date: dmestas on 2026-08-19 12:44:01
Changes

  1. icomment:
    Fixed the substance; one refinement deliberately remains.
    
    **1. Additive is codified as the default.** The migration list is now a
    named `migrations` var whose comment states the policy, and
    `schemaVersion`'s doc points at it first: an ALTER ships online with
    the forge serving throughout; bump the version ONLY when the change
    cannot be expressed additively.
    
    **2. Reset now actually resets the shape.** It drops every derived
    table (fts and its shadows, attachment — which the row-delete list had
    silently missed — included) and reapplies the schema through the same
    `applySchema` that Open uses, so "the shape" has exactly one
    definition, then stamps the version. `TestResetRepairsShape` recreates
    the incident (a column the file's shape lacks) and proves Reset →
    refold lands, search corpus included. The version mechanism no longer
    promises a repair it cannot perform.
    
    **3. Repair no longer costs an outage.** `repo.reindex` (POST
    /api/v1/r/{repo}/reindex, Admin) runs the wipe-and-replay in process
    while the forge serves. It goes through the ingest lane, so a
    fleet-wide repair is staged at --ingest-limit stores at a time rather
    than a stampede; the indexing flag shows on /fleet while it runs; the
    generation bump drops the memos hanging off the old shape. A nil
    pipeline refuses cleanly. The offline CLI remains for a stopped server.
    
    **4. Staging** already existed — --ingest-limit (default 3) bounds
    concurrent rebuilds — and is now load-bearing for the op above.
    
    **Remaining, out of scope:** a zero-degraded-window rebuild. During an
    in-process reindex the repo's surfaces serve partial data (flagged as
    indexing) until the replay lands. The clean fix is running the whole
    Reset+replay in one WAL transaction so readers keep the old snapshot
    until commit — plumbing a single tx through the fold batches. Worth
    doing when a rebuild window on a big store actually hurts someone.
    
  2. mimetype: "text/x-markdown"
  3. resolution changed to: "Fixed"
  4. status changed to: "Fixed"