|
2026-09-24
| ||
| 00:53 | • Ticket [d725bd29c5] tk: artifacts the store holds are missing from the index and a rebuild does not restore them status still Fixed with 1 other change artifact: a87bb54924 user: zeitgeist | |
|
2026-08-19
| ||
| 15:42 | • Fixed ticket [d725bd29c5]. artifact: ee48d5e2a6 user: dmestas | |
| 12:10 | • Ticket [d725bd29c5]: 1 change artifact: 3fb39ee95c user: dmestas | |
| 11:04 | • Ticket [d725bd29c5]: 2 changes artifact: 7820789086 user: dmestas | |
| 00:10 | • New ticket [d725bd29c5]. artifact: 9d5fc07105 user: dmestas | |
tk: artifacts the store holds are missing from the index and a rebuild does not restore them
## What is observed
After `quarry reindex` replays all 69,182 artifacts, the index still holds check-in edges whose parent it does not have — and unlike fossil, tcl, sqlite and libfossil, whose dangling ancestors are genuinely absent from the store (shunned, or an import that began partway down the DAG), **the tk store still holds these artifacts**. Verified per hash with `zit artifact <hash> -R`, which succeeds.
So this is real loss, reproducible across rebuilds:
ingest: tk: 1 artifacts the store holds are missing from the index; rebuilding ingest: tk: STILL 1 artifacts missing after a full rebuild — NOT retrying
The pipeline now stops after one attempt rather than replaying the store every two minutes forever, and reports the count in fleet health.
## Why a rebuild does not fix it
Unknown, and that is the work. Leads, in the order worth trying:
1. **The census outruns the window during the rebuild itself.** ZITEVT is capped (1 GiB, one hour, discard-old) and `flushBytes` bounds one burst at 64 MB, but tk is the largest ticket corpus in the fleet — 12,028 tickets, 69,182 artifacts. If a fold is slow enough that a burst's head ages past MaxAge while its tail is still being written, the head is dropped unacked and never republished. That is the same mechanism that caused the original damage, just reached by time rather than size, and `flushBytes` does not defend against it. 2. **An artifact that fails to parse is skipped silently.** `each` logs "treating as content" and returns nil for a nil parse. If tk holds an artifact shape the parser drops entirely, its edges would dangle forever and no rebuild would help. Check whether the missing hashes parse at all. 3. **A fold error mid-batch.** Fold is one transaction per fetched batch and only acks on success, so this should be safe — but it is worth confirming the specific hashes are not in a batch that consistently errors.
## Where to start
Get the hashes, then ask what they are:
SELECT DISTINCT p.parent FROM checkin_parent p WHERE NOT EXISTS (SELECT 1 FROM checkin WHERE hash = p.parent)
and for each, `zit artifact <hash> -R <store>` to see its type and cards. If they are all one artifact type, lead 2 is the answer.
## Why it matters
A missing check-in is not a cosmetic gap. It orphans the DAG: the timeline draws a second branch rail where there is one branch, and marks a mid-history commit as a leaf. That is how this whole class of bug was found — the fleet page said `ok` while the index was quietly serving an incomplete history as though it were whole.
Root-caused, and lead 2 was right in an unexpected way: the "missing check-in" is not missing and is not a check-in.
cd4f6a34… is tkMacOSXEvent.c — a plain C source blob. Check-in
2b9302ce… (2011-07-18, CVS-conversion era) carries a P card naming
that blob as its parent. This is tk's history as written: fossil's own
database records the same plink edge at face value and creates no
timeline event for the blob, so fossil's timeline draws the same
disconnected segment quarry's does. The index was never wrong; the
probe's definition of "repairable" was.
Fix (8a96f742): lostArtifacts now parses each probed artifact and
counts only those the store holds AS MANIFESTS. Holding the hash is not
holding a check-in — a blob parent is the same category as a shunned
ancestor: inherent history, not loss. The regression test folds tk's
exact shape (a check-in whose parent is a file blob in a real store)
and pins lost == 0.
Effects: tk no longer rebuilds 69,182 artifacts chasing a gap no rebuild can close, no longer reports itself permanently broken on /fleet, and the gap signal is quiet on a healthy boot — so when Gaps is non-zero again it will MEAN loss, which is the whole value of the signal. The timeline's rendering of the 2011 orphan stands, in exact agreement with fossil's.