Files
document-haness/docs/keycloak-session-store/source/docs/evidence/b7a-orphan-session
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
..

B-7a — 고아 세션의 수명과 정리 증거

2026-09-04 11:29 – 11:34 UTC 해설: docs/experiment-b7a-orphan-session.md

파일 무엇을 보여주는가
01-orphan-lifecycle.txt 회전 2회로 고아가 누적하는 것 · TTL 이 1초/초로 줄고 요청으로 갱신되지 않는 것 · Redis 만으로는 구분 불가(이름·타입·크기 동일, 값 암호화) · redis-cli del 로 지워도 산 세션은 200 · TTL 역산 정리 규칙이 1초 오차로 맞는 것
b7a-live-session-after-orphan-delete.png 고아를 지운 직후 살아있는 세션이 /oauth2/userinfo 를 정상 응답하는 브라우저 화면

핵심 다섯 줄

  1. 「지울 수 없다」는 oauth2-proxy 의 한계이지 Redis 의 한계가 아니다. 프록시는 티켓을 못 풀어 키를 계산 못 한다. 운영자는 키를 직접 안다 — del 반환 1, dbsize 2→1, 산 세션은 그대로 200.
  2. 고아는 반드시 사라진다 — 생성 후 정확히 1시간. TTL 이 요청으로 갱신되지 않기 때문이다(refresh:disabled). 다만 그 1시간은 남는다.
  3. 회전할 때마다 누적한다. 1차 회전을 살아남은 세션이 2차 회전에서 고아가 됐다. 회전 1회 = 그 시점 로그인 사용자 수만큼.
  4. Redis 값으로는 고아를 못 고른다. 이름 접두사·타입·크기(3510바이트)가 같고 값은 암호화되어 있다. TTL 만이 신호다.
  5. 그 TTL 로 정리 규칙이 유도된다. 생성시각 = 지금 − (cookie-expire − TTL) 이 회전 시각보다 이르면 고아다. 추정 11:30:26 대 로그 11:30:27 — 1초 오차. 실제로 골라 지웠고 산 세션만 남았다.