Files
document-haness/docs/clean-architecture-backend-template/final/evidence/raw/a-replay-store-with-no-eviction-path.txt
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

55 lines
2.7 KiB
Plaintext

# 결과 재생 저장소 — 항목 하나의 크기만 제한한다
private final ConcurrentMap<String, byte[]> storedOutcomes = new ConcurrentHashMap<>();
private final int maxInlineBytes;
if (serializedResponse.length > maxInlineBytes) {
throw new IllegalArgumentException(
"response of "
+ serializedResponse.length
+ " bytes exceeds the inline outcome limit of "
+ maxInlineBytes
+ "; store it behind an object reference instead");
}
storedOutcomes.put(outcomeReference, serializedResponse.clone());
# remove / clear / evict / expire 매치: 0
# 개수를 볼 수 있는 유일한 창구
public int size() {
return storedOutcomes.size();
}
# 그 값을 읽는 main 코드: 0
# 이 클래스를 잡는 main 코드: 0
# javadoc 이 이 저장소를 부르는 이름
* against whatever the deployment chose — a small inline store, an object store, or a re-read of
* the committed resource.
# 형제 모듈의 중복 제거기 — 같은 형태를 자기 javadoc 이 비판한다
* <p>Checkpoint-based rather than a set of seen keys. A set grows without bound for the life of a
* session and answers "have I seen this" — which is not quite the question. The question is "has
* this been applied", and a monotonic applied-sequence answers it in constant space and survives
* the process restart that a set does not.
*
* <p>Replayed outcomes are kept for the small window after the checkpoint, so a duplicate that
* arrives before the checkpoint advances gets the original answer rather than being reapplied.
# 비판을 지키는 쪽: 세션당 항목 하나
private final ConcurrentMap<String, GrpcClientStreamCheckpoint> checkpoints =
new ConcurrentHashMap<>();
private final ConcurrentMap<String, String> replayableOutcomes = new ConcurrentHashMap<>();
# 지키지 않는 쪽: 적용된 메시지마다 한 항목
if (outcomeReference != null && !outcomeReference.isBlank()) {
replayableOutcomes.put(message.dedupKey(), outcomeReference);
}
}
# 재생 판정이 실제로 보는 것
54: if (checkpoint.alreadyApplied(message.sequence())) {
# 이 파일의 remove / clear / removeIf 매치: 2
# 그 둘이 있는 자리
/** Forgets a finished session. */
public void endSession(GrpcClientStreamSessionId sessionId) {
checkpoints.remove(sessionId.value());
replayableOutcomes.keySet().removeIf(key -> key.startsWith(sessionId.value() + "|"));
}
# 그 접두사가 실제로 무엇인가
public String dedupKey(long sequence) {
return value + "|" + generation + "|" + sequence;
# 두 모듈의 런타임 소속: grpc-policy=[] grpc-advanced-streaming=[]