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>
55 lines
2.6 KiB
Markdown
55 lines
2.6 KiB
Markdown
---
|
|
kind: REFERENCE
|
|
slug: ambiguity-rule-hurts-both-ways
|
|
title: 커밋 모호성 판정은 넓혀도 좁혀도 해롭다
|
|
topic: commit-ambiguity-as-a-result
|
|
project: clean-architecture-backend-template
|
|
status: 게시 전
|
|
sourceRevision: 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916
|
|
rootTreeNode: reference:ambiguity-rule-hurts-both-ways
|
|
verifiedOn: # 이 기록은 이번 회차에 실행 확인을 하지 않았다
|
|
---
|
|
|
|
# 커밋 모호성 판정은 넓혀도 좁혀도 해롭다
|
|
|
|
## 목적
|
|
|
|
모호성 규칙을 한 방향으로만 조정해서, 반대편 비용을 보지 못한 채 규칙을 옮기는 것을 막는다.
|
|
|
|
## 규칙
|
|
|
|
1. 좁게 두면 모호한 실패가 확정 롤백으로 오인된다
|
|
그리고 확정 롤백은 재시도된다. 커밋됐을 수도 있는 쓰기가 다시 실행되는 경로가 여기서 열린다.
|
|
|
|
2. 넓게 두면 조정 큐가 무의미해진다
|
|
평범한 풀 고갈과 서버 재시작이 조정 큐로 밀려들면 운영자는 그 큐를 읽지 않고 비우는 습관을 배운다. 정작 중요한 항목 하나가 나머지와 함께 지워진다.
|
|
|
|
3. 기준은 두 조건의 교집합이다
|
|
이 SQLSTATE 가 커밋 단계에서 발생했는가, 그리고 드라이버가 어느 쪽인지 말해 주지 못하는가. 둘 다 참일 때만 모호성이다.
|
|
|
|
4. 판정 재료는 두 가지이며 어느 하나로는 부족하다
|
|
관측된 트랜잭션 단계와 SQLSTATE 또는 예외 타입이다.
|
|
|
|
5. 넓힌 규칙은 테스트로 고정한다
|
|
상태 목록을 조용히 줄이는 경로를 닫아야 한다. SQLSTATE 를 직접 단언하는 계약 테스트가 그 역할을 한다.
|
|
|
|
## 적용 조건
|
|
|
|
커밋 실패 분류를 갖는 모든 데이터 계층
|
|
|
|
## 예외
|
|
|
|
연결 유실이 커밋을 불명으로 남겼는지는 단계에 달렸다. 따라서 08 로 시작하는 상태를 그 자체로 completion-unknown 으로 두면 안 된다. 벤더 분류기는 그것을 연결 불가로만 두고, 단계를 아는 커밋 분류기가 따로 판정한다.
|
|
|
|
## 예시
|
|
|
|
57P01 은 class 08 이 아니다. 클라이언트의 연결 시도가 아니라 서버가 자기 종료를 알린 것이기 때문이다. 그러나 커밋 입장에서는 결과가 같고 더 나쁘다. 그 상태가 도착할 때 커밋 레코드가 이미 WAL 에 있을 수 있다.
|
|
|
|
## 관계
|
|
|
|
- **pg_terminate_backend가 57P01로 도착하고 커밋 레코드는 이미 WAL에 있었다**
|
|
이 규칙이 넓혀진 사례다.
|
|
- **completion-unknown은 자동으로도 수동으로도 재시도하지 않는다**
|
|
이 판정이 만들어 내는 예외를 다루는 결정이다.
|
|
|