Skip to content
quarry History Of Ticket 0e488373ec
Login

History Of Ticket 0e488373ec

Artifacts Associated With Ticket 0e488373ec

  1. Ticket change [9edc6a5de6] (rid 1052) by dmestas on 2026-08-19 10:44:08:

    1. Untracked field cmimetype: "text/x-markdown"
    2. comment initialized to:
      Bumping `schemaVersion` currently means: every repository's index is
      wiped and refolded from its store. On this corpus that is a multi-minute,
      stop-the-world rebuild of 23 stores during which every derived surface —
      timeline, tickets, search, counts — is empty or wrong. In production it
      is an outage of the whole forge, triggered by adding a column.
      
      It is also a trap rather than a tool, because `Index.Reset` deletes ROWS
      and never changes SHAPE. So the one thing the version stamp exists to
      signal is the one thing its remedy cannot perform: on 2026-08-19 a
      version bump that added five ticket columns wiped every index and then
      failed every ticket fold with "no such column", because
      `CREATE TABLE IF NOT EXISTS` cannot widen a table that already exists.
      
      ### Required
      
      1. **Additive migration is the default path.** `ALTER TABLE ... ADD
         COLUMN` plus a bounded backfill, applied online, with no wipe. `Open`
         already documents this as "the lighter mechanism than a rebuild" and
         already carries a migration list; new columns belong there. The
         version bump should be reserved for changes that genuinely cannot be
         expressed additively.
      
      2. **`Reset` must actually reset the shape** — drop the derived tables
         and re-exec the schema — or the version mechanism must stop implying
         it can. Today it silently promises one and delivers the other.
      
      3. **Rebuild online, never in place.** Build into a new index file and
         swap atomically, so the serving index is never the one being rebuilt.
         This also removes the exclusive-access deadlock: today `quarry
         reindex` and `quarry serve` contend for the same files, so the only
         way to repair a store is to take the forge down.
      
      4. **Stage it.** Reindex one repository, verify it against the store,
         then continue. Wiping 23 at once turns a recoverable mistake into a
         corpus-wide one.
      
      ### Acceptance
      
      Adding a column to a derived table must be shippable with the forge
      serving traffic throughout, and must not be able to empty an index if
      the migration is wrong.
      
    3. priority initialized to: "High"
    4. severity initialized to: "Severe"
    5. status initialized to: "Open"
    6. subsystem initialized to: "index"
    7. title initialized to:
      Schema changes must migrate online, not wipe every index
      
    8. type initialized to: "Code_Defect"
  2. Ticket change [4ecc6ef929] (rid 1105) by dmestas on 2026-08-19 12:10:37:

    1. subsystem changed to: "index"
  3. Ticket change [628e48c253] (rid 1160) by dmestas on 2026-08-19 12:44:01:

    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"
  4. Ticket change [0c66e75fe8] (rid 12473) by zeitgeist on 2026-09-24 00:53:02:

    1. Untracked field number: "38"