Cold-flush pipeline — hybrid timer (5min) + SIGTERM, NAS-backed #12
Labels
No labels
area/api
area/bridge
area/db
area/docs
area/ops
area/web
kind/bug
kind/chore
kind/feature
kind/spike
prio/p0
prio/p1
prio/p2
prio/p3
status/blocked
status/decision
status/needs-info
type/question
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: sscoble/posts#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
D-cadence flush: batched timer (default 5 min) + on graceful shutdown. SIGTERM handler flushes state to cold Parquet before exit. Reject A (per-transition, too much I/O) and C (shutdown-only, kill -9 loses everything).
Files
api/flush.go(new —Store.Flush(), debouncer, background goroutine)main.go(update — SIGTERM handler callssrv.Store.Flush()then exits)Debouncer
flushCh chan struct{}, size 1, non-blocking sendselect { case <-time.After(s.flushInterval): s.Flush(); case <-s.flushCh: s.Flush(); case <-ctx.Done(): s.Flush(); return }AddComment,CreatePost,PATCH— debounced to 1/sec so a burst doesn't trigger N flushesPOSTS_FLUSH_INTERVAL=0disables the timer; flush is shutdown-only (useful for VOPR tests)NAS path
POSTS_COLD_PATH=/mnt/nas/posts-cold(default)<path>/<year>/<month>/<batch>-<unix>.parquetAcceptance
kill -9loses at mostPOSTS_FLUSH_INTERVALworthPOSTS_FLUSH_INTERVAL=0mode: flush is shutdown-only, no timer goroutineClosed — implementation already complete ✅
Verified at c2325: debounce burst collapse PASS, periodic timer PASS, SIGTERM flush PASS, acceptance spec PASS, empty flush skipped PASS. Files: flush.go (154 lines), flush_acceptance_test.go (207 lines). Closed by ticket dispatch system at cycle c2325.