orama/core/pkg/serverless
anonpenguin23 93556ab786 fix(serverless): startup backfill to re-pin all function WASM (GC-safety)
Incident 2026-06-24: scheduled IPFS GC (0.122.67) deleted the WASM of 14 active
functions that were never durably pinned (old uploadWASM only warn-logged pin
failures). 0.122.68 fixed the deploy path (pin-everywhere + hard-fail); this
adds the missing piece for EXISTING functions:

- Registry.RepinAllWASM re-pins every active function's WASM cluster-wide
  (replication=-1), best-effort + idempotent (gone/GC-deleted blocks are logged
  and skipped, surviving ones protected).
- Runs as a delayed background goroutine on gateway startup so every function's
  WASM is durably pinned + GC-safe without manual intervention; the
  rolling-restart cadence naturally staggers it and the cluster dedups pins.

So GC can never again reclaim function WASM. (The currently-deleted 14 still need
an AnChat re-deploy — their bytes are gone; tracked on bug #137.)
2026-06-24 12:16:20 +03:00
..