C.W.K.
Stream
Lesson 03 of 06 · published

Write-Before-Show — Eager Append, 주기적 fsync

~12 min · fsync, durability

Level 0호기심
0 XP0/65 lessons0/17 achievements
0/100 XP to next level100 XP to go0% complete

strict 한 순서의 pipeline

  1. JSONL append (eager write) — durability. commit 지점.
  2. SQLite update — convenience / queryable state.
  3. ChromaDB update (async) — semantic search index.
  4. SSE yield to frontend — presentation. 아빠가 봄.

invariant

아빠는 JSONL 에 이미 있지 않은 걸 절대 안 봐.

step 4 가 step 1 전에 못 일어나. step 1 fail 시 bail — yield X, 깨진 chat X. 에러가 적절한 error state 로 surface, 정직. step 2 또는 3 fail 시 아빠 여전히 yield 봄 (데이터가 이미 JSONL 에 durable 이라), drifted mirror 는 나중에 purge-and-replay 로 재구축.

fsync — eager append + 주기적 fsync

per-token fsync 는 prohibitively 비싸. 모델: 모든 event 마다 eager file.write() + newline, structural event (tool_use, tool_result, done, usage, session, emotion, error) 와 long text run 동안 짧은 ~250ms timer 에 주기적 fsync.

eager append 가 데이터를 즉시 kernel page cache 에 — 프로세스 crash, abort-induced quirk 살아남기 충분. 주기적 fsync 가 의미 있는 checkpoint 에서 disk-level durability. hardware 정전 worst case: 마지막 fsync 이후 ~250ms 의 delta 손실. 수용 가능.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고
💛 by 똘이warm💛 by 피파warm

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.