Files
document-haness/docs/keycloak-session-store/final/.techviz/a3-commit-to-disk-gap/spec.json
T
DongHyeonkaandClaude Opus 5 95c0e680b5 docs(keycloak-session-store): take the sentences out of the diagram canvases
The skill says drawings carry names and sentences go in <desc> and the
paragraph beside the figure. I put sentences in node details and edge labels
instead, and 27 of the 28 diagrams shipped with prose inside the canvas —
"예측 다섯 개가 틀렸다", "아홉 번 조용히 실패했다", "막혀서 닿지 않는다".

Only label and details render on the canvas; description does not. So every
sentence moved to a noun phrase and the meaning stays in description, which
was already carrying it.

  막혀서 닿지 않는다              -> 차단
  아홉 번 조용히 실패했다         -> 조용한 실패 9건
  예측 다섯 개가 틀렸다           -> 틀린 예측 5건
  로그아웃이 정리하지 않는다      -> 로그아웃 미정리
  볼륨이 없으면 여기까지다        -> 볼륨 없음

Three node labels were sentences too and became names: 세션 스냅샷, 예측
선기록, 대조군 확보.

What stays is what the rules protect — identifiers, commands and measured
values: PRIMARY KEY (client_registration_id, principal_name),
ValidationFailedException: 1 changesets check sum, nginx -t && nginx -s
reload, SET LOCAL synchronous_commit TO OFF. Those are names of things, not
prose about them.

294 canvas strings across 28 diagrams, none matching a sentence ending,
average 11 characters. All 28 still lint clean and re-rendered.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-05 11:50:33 +09:00

154 lines
4.3 KiB
JSON

{
"version": "1.1",
"id": "a3-commit-to-disk-gap",
"title": "200 과 디스크 사이의 빈 구간",
"question": "로그인이 성공했는데 세션이 없을 수 있는 이유는 무엇인가",
"type": "architecture",
"direction": "TB",
"audience": [
"RPO 를 따져야 하는 운영 엔지니어"
],
"summary": "Keycloak 이 트랜잭션마다 synchronous_commit 을 끄기 때문에 COMMIT 이 WAL 디스크 기록을 기다리지 않는다. 그 사이에 죽으면 그만큼 사라진다.",
"alt": "클라이언트가 200 을 받은 뒤에도 WAL 이 아직 디스크에 닿지 않은 구간이 남아 있는 구성.",
"long_description": "Keycloak 은 트랜잭션마다 SET LOCAL synchronous_commit TO OFF 를 건다. PostgreSQL 은 COMMIT 을 WAL 디스크 기록을 기다리지 않고 즉시 반환하고, 클라이언트는 200 과 토큰을 받는다. 실측된 wal_writer_delay 는 200ms 이며 그 사이에 프로세스가 죽으면 그만큼이 사라진다. 153건 중 4건이 그렇게 유실됐다. 버그가 아니라 의도된 설계이고 그 대가를 숫자로 확인한 것이다.",
"source_context": {
"document": "docs/keycloak-session-store/final/document.md",
"document_sha256": "1d44cba1905544d92f1d26ae36a8deb64a3db3914d6b488fd30d6ae7f8cfbabe",
"anchor": {
"kind": "heading",
"value": "A-2 · A-3 — DB 가 멈출 때와 죽을 때",
"line": 201
}
},
"composition": {
"profile": "component-flow",
"diagram_only": true,
"reference_ids": [
"payment-event-flow"
],
"rationale": "응답이 돌아가는 시점과 데이터가 디스크에 닿는 시점이 다르다는 것이 지배적 질문이다. 경로의 시간 차이이므로 component-flow 를 골랐다."
},
"groups": [],
"nodes": [
{
"id": "client",
"label": "클라이언트",
"kind": "actor",
"role": "source",
"emphasis": "primary",
"description": "200 과 토큰을 받는다.",
"details": [
"성공 응답 153건"
],
"evidence": [
{
"start_line": 207,
"end_line": 213
}
],
"assumption": false
},
{
"id": "keycloak",
"label": "Keycloak",
"kind": "service",
"role": "control",
"emphasis": "normal",
"description": "트랜잭션마다 synchronous_commit 을 끈다.",
"details": [
"SET LOCAL synchronous_commit TO OFF"
],
"evidence": [
{
"start_line": 211,
"end_line": 215
}
],
"assumption": false
},
{
"id": "pg",
"label": "PostgreSQL",
"kind": "datastore",
"role": "control",
"emphasis": "warning",
"description": "COMMIT 을 즉시 반환한다. WAL 은 아직 메모리에 있다.",
"details": [
"wal_writer_delay 200ms"
],
"evidence": [
{
"start_line": 211,
"end_line": 215
}
],
"assumption": false
},
{
"id": "disk",
"label": "디스크의 WAL",
"kind": "datastore",
"role": "target",
"emphasis": "primary",
"description": "여기 닿아야 살아남는다.",
"details": [
"DB 존재 149건"
],
"evidence": [
{
"start_line": 207,
"end_line": 215
}
],
"assumption": false
}
],
"edges": [
{
"id": "c-k",
"from": "client",
"to": "keycloak",
"label": "로그인 요청",
"kind": "request",
"evidence": [
{
"start_line": 207,
"end_line": 211
}
],
"assumption": false
},
{
"id": "k-pg",
"from": "keycloak",
"to": "pg",
"label": "세션 INSERT · COMMIT",
"kind": "write",
"evidence": [
{
"start_line": 211,
"end_line": 215
}
],
"assumption": false
},
{
"id": "pg-disk",
"from": "pg",
"to": "disk",
"label": "지연된 WAL 기록",
"kind": "write",
"evidence": [
{
"start_line": 211,
"end_line": 215
}
],
"assumption": false
}
],
"legend": [],
"metadata": {
"rationale": "성공 응답과 영속화를 두 사건으로 분리했다. RPO 가 0 이 아닌 이유가 그 사이에 있다."
}
}