Files
document-haness/docs/keycloak-session-store/source/docs/evidence/a3-database-crash
DongHyeonkaandClaude Opus 5 b2963105a8 docs(keycloak-session-store): import the session-storage lab as a new project
The keycloak project ended with four open questions that design could not
settle. A two-VM lab was built to answer them by measurement, and this is
that material: 26 experiments, 125 raw command outputs, 22 browser captures.

Follows the import procedure in README.md.

  source/     the originating repository verbatim — 78 documents, 28 SVGs,
              8 manifests, plus .source-revision recording the commit
  final/      the SSOT
    document.md   729 lines written from the 29 experiment documents, not
                  concatenated: what was predicted, what was measured, and
                  where the measurement itself was wrong
    evidence/raw    125 outputs, flattened to <experiment>__<file> because
                    the originals collided (01-baseline.txt appeared three
                    times) and the audit only globs the top level
    evidence/meta   one per raw file; command and exitCode are null and the
                    README says why rather than inventing them
    evidence/browser  22 captures
    assets/       three diagrams through techviz
    .techviz/     their VizSpecs

A separate project rather than an addition to keycloak: the B-layer answers
that project's four questions, but the A, C and D layers are about cluster
failure, SSO and operations, and one document.md should hold one subject.
The four question records there can point here through 관계.

Recorded rather than papered over: only three of the 28 diagrams were
remade. The repository forbids hand-drawn SVG and forbids titles inside the
canvas; all 28 originals carry both, so converting them is redrawing, not
reformatting. They stay in source/ and the gap is written into the document.

verify-pipeline.py passes. audit-records.py reports no issues.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 22:51:59 +09:00
..

A-3 — DB 강제 종료와 데이터 손실 증거

2026-09-04 12:0012:05 KST · Keycloak 26.7.0 / PostgreSQL 16 해설: docs/experiment-a3-database-crash.md

파일 무엇을 보여주는가
01-crash-injection.txt 첫 시도 실패 — 파드 안 백그라운드 루프가 exec 종료와 함께 죽어 0건 수집
02-design-check.txt 핵심 설계 확인 — 로그인 트랜잭션도 SET LOCAL synchronous_commit TO OFF 로 커밋한다
03-loss-measurement.txt --grace-period=0 --force 주입
04-comparison.txt 유실 0건 — 그러나 crash recovery 가 안 돌았다. 죽인 적이 없는 것
05-true-crash.txt kill -9 1 시도 — 컨테이너 안에서 PID 1 은 SIGKILL 을 무시한다
06-backend-kill-crash.txt 성공한 주입 — 백엔드에 SIGKILL → not properly shut down / redo starts / redo done
07-loss-result.txt 결과: 153건 중 4건 유실. 토큰은 발급됐는데 세션 행이 없는 sid 목록

핵심 세 줄

  1. 로그인도 비동기 커밋이다. refresh 시각뿐 아니라 로그인 자체가 사라질 수 있다.
  2. 153건 중 4건(약 2.6%) 유실 — 초당 19건 기준 마지막 0.2초 분량, wal_writer_delay 기본값과 일치.
  3. 주입을 세 번 시도해 세 번째에 성공했다. 앞의 둘은 "손실 0"으로 보였지만 실제로는 크래시가 아니었다.