Files
document-haness/docs/clean-architecture-backend-template/tech-log-studio/state-machines-and-ownership/concept/concept-application-core-c05.md
T
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

3.0 KiB

kind, slug, title, topic, project, status, sourceRevision, rootTreeNode, evidenceCapturedOn, assets, evidence, source, module
kind slug title topic project status sourceRevision rootTreeNode evidenceCapturedOn assets evidence source module
CONCEPT application-core-c05 efficiency lock이 correctness authority를 대체하지 않는다 state-machines-and-ownership clean-architecture-backend-template 게시 전 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916 concept:application-core-c05 2026-09-01
key file
application-core-c05 ../../../final/evidence/rendered/application-core-c05.svg
../../../final/evidence/raw/application-core-c05.txt
원본 분석 절은 analysis/03-application-core.md#L152 이다.
application-core

efficiency lock이 correctness authority를 대체하지 않는다

CacheAsideExecutor는 결과 종류를 명시적으로 구분하고, lease와 lock은 EFFICIENCY_ONLY로 자기 보증 등급을 스스로 적는다.

관계

  • legacy storage/notification compatibility surface의 제거 조건 추적 같은 분석 리프에서 끌어낸 규칙이다.

본문

CacheAsideExecutor는 fresh/negative hit, hard miss, stale, incompatible schema, provider unavailable을 명시적으로 구분한다. source load에는 key-local single-flight와 global source bulkhead를 함께 적용한다. in-flight key 수, waiter 수, source concurrency, admission wait, load deadline이 모두 bounded다.

CacheAsideExecutor 참조 위치

:::evidence key="application-core-c05" alt="코드베이스에서 CacheAsideExecutor 를 검색한 출력 22줄. 이 기록이 세는 참조가 그 출력에 그대로 보인다." caption="CacheAsideExecutor 코드베이스 검색 — 22줄 · exit 0" zoom="true" :::

stale을 돌려주는 조건과 돌려주지 않는 조건

stale value는 hard expiry 이전이며 classified transient failure일 때만 fallback될 수 있다. permanent failure에는 stale을 반환하지 않는다.

invalidate 직후의 resurrect race를 막는 방법

source load 중 invalidation이 발생하면 lookup 때 캡처한 CacheWriteCondition이 더 이상 일치하지 않아 이전 source result의 refill을 거부한다. 이는 invalidate 직후 늦게 끝난 source load가 stale value를 resurrect하는 race를 막는다.

refresh 조정은 correctness lock이 아니다

optional distributed refresh coordination은 soft lease로 한 pod만 refresh하도록 하지만 correctness lock은 아니다. owner는 lease 획득 후 cache를 재확인해 다른 pod가 이미 fill했다면 source를 호출하지 않는다. claim 결과가 indeterminate이면 동일 attempt token으로 한 번만 재시도한다. contender는 stale이 아직 valid하면 즉시 stale을 반환할 수 있다.

single-flight가 leader를 영원히 두지 않는 방법

CacheSingleFlight는 waiter timeout/interruption을 보존하고 완료된 flight를 제거한다. leader가 영원히 남아 key bound를 점유하지 않도록 monotonic deadline 이후 abandoned flight를 opportunistic reap한다.