Restamp follow-ups from the v0.32.0 review: refusal status, sidecar on refusal, no-time rows multiply #52

Open
opened 2026-10-26 19:29:18 -04:00 by serversdown · 0 comments
Owner

Summary

Follow-ups from the independent review of fix/waveform-time-restamp (847900b, abb671a, 3948dc1, released in v0.32.0). None blocks the release; each is measured or marked inferred.

Items

  1. A refusal looks like success (review I1). When a different stored file already holds an event's corrected second, insert_events refuses and returns (0, 1), the same as an ordinary refresh.
    • server.py reports "status": "ok".
    • series3-watcher marks the file forwarded and never retries.
    • Nothing is lost: the file and sidecar are already stored. But a refused re-pair forward never applies its report peaks, and only a log line says so.
    • Fix: a third count, or a per-file "conflict" status in the import response.
    • Expected rate: 0 in the deploy rehearsal on prod's 2026-09-30 snapshot (all 11,827 files) once waveform times come from the filename.
  2. A refused row's sidecar and .h5 disagree with the DB (I2). backfill_sidecars.py writes the sidecar and .h5 with the new time before insert_events refuses. Fix: decide the time first, or write the DB's time back on a refusal.
  3. Concurrent writer (M4, inferred). The restamp UPDATE isn't guarded. A writer between the check and the UPDATE raises IntegrityError and rolls back the batch. This matters only if a backfill runs alongside a live SFM.
  4. Rows with no time multiply (M5, pre-existing, measured). BE18003/T003LCYV.JD0H decodes with no timestamp. A NULL never conflicts with UNIQUE(serial, timestamp), so every store or backfill adds another row.
    • The Sep 2 prod DB copy holds 11 such rows; the v0.32.0 deploy rehearsal added one more (11,827 → 11,828).
    • Fix: match a no-time event by its Blastware filename (as the restamp already does for timed ones), or decode the time.
  5. Untested restamp branches (M3). The serial scope, the timestamp IS NULL clause and holder[1] is None survived mutation.

Related: #51 (the histogram time key change).

## Summary Follow-ups from the independent review of `fix/waveform-time-restamp` (`847900b`, `abb671a`, `3948dc1`, released in v0.32.0). None blocks the release; each is measured or marked inferred. ## Items 1. **A refusal looks like success (review I1).** When a different stored file already holds an event's corrected second, `insert_events` refuses and returns `(0, 1)`, the same as an ordinary refresh. - `server.py` reports `"status": "ok"`. - `series3-watcher` marks the file forwarded and never retries. - Nothing is lost: the file and sidecar are already stored. But a refused re-pair forward never applies its report peaks, and only a log line says so. - Fix: a third count, or a per-file `"conflict"` status in the import response. - Expected rate: **0** in the deploy rehearsal on prod's 2026-09-30 snapshot (all 11,827 files) once waveform times come from the filename. 2. **A refused row's sidecar and `.h5` disagree with the DB (I2).** `backfill_sidecars.py` writes the sidecar and `.h5` with the new time before `insert_events` refuses. Fix: decide the time first, or write the DB's time back on a refusal. 3. **Concurrent writer (M4, inferred).** The restamp `UPDATE` isn't guarded. A writer between the check and the `UPDATE` raises `IntegrityError` and rolls back the batch. This matters only if a backfill runs alongside a live SFM. 4. **Rows with no time multiply (M5, pre-existing, measured).** `BE18003/T003LCYV.JD0H` decodes with no timestamp. A NULL never conflicts with `UNIQUE(serial, timestamp)`, so every store or backfill adds another row. - The Sep 2 prod DB copy holds 11 such rows; the v0.32.0 deploy rehearsal added one more (11,827 → 11,828). - Fix: match a no-time event by its Blastware filename (as the restamp already does for timed ones), or decode the time. 5. **Untested restamp branches (M3).** The serial scope, the `timestamp IS NULL` clause and `holder[1] is None` survived mutation. Related: #51 (the histogram time key change).
serversdown added the Kind/Bug
Priority
Low
4
labels 2026-10-26 19:29:18 -04:00
Sign in to join this conversation.