GC engine (internal/gc/): Collector.Run() implements the two-phase algorithm — Phase 1 finds unreferenced blobs and deletes DB rows in a single transaction, Phase 2 deletes blob files from storage. Registry-wide mutex blocks concurrent GC runs. Collector.Reconcile() scans filesystem for orphaned files with no DB row (crash recovery). Wired into admin_gc.go: POST /v1/gc now launches the real collector in a goroutine with gc_started/gc_completed audit events. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7 lines
146 B
Go
7 lines
146 B
Go
package gc
|
|
|
|
import "errors"
|
|
|
|
// ErrGCRunning indicates that a GC run is already in progress.
|
|
var ErrGCRunning = errors.New("gc: already running")
|