Files
document-haness/docs/clean-architecture-backend-template/tech-log-studio/schema-ownership-and-capability-streams/case/case-two-trees-both-numbered-from-v1.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

92 lines
4.1 KiB
Markdown

---
kind: CASE
slug: two-trees-both-numbered-from-v1
title: 두 트리가 다 V1부터 번호를 매겨 공유 history가 하나를 건너뛸 수 있었다
topic: schema-ownership-and-capability-streams
project: clean-architecture-backend-template
status: 게시 전
sourceRevision: 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916
rootTreeNode: case:two-trees-both-numbered-from-v1
evidenceCapturedOn: 2026-09-01
assets:
- key: two-trees-both-numbered-from-v1
file: ../../../final/evidence/rendered/two-trees-both-numbered-from-v1.svg
evidence:
- ../../../final/evidence/raw/two-trees-both-numbered-from-v1.txt
source:
- 원본 분석 절은 final/document.md#4-1 · analysis/05 §8.3 이다.
---
# 두 트리가 다 V1부터 번호를 매겨 공유 history가 하나를 건너뛸 수 있었다
알림 마이그레이션이 기본 위치 밖에 있어서 아무것도 적용되지 않았다. 위치 목록에 더하는 명백한 수정은 두 트리의 V1 을 같은 버전으로 만들었을 것이고, Flyway 는 해석 순서에 따라 하나를 건너뛸 수 있었다.
## 관계
- **독립 Flyway 스트림과 baseline version 0**
이 사례가 만든 구조다.
- **마이그레이션 스트림은 자기 history 테이블을 갖는다**
이 사례에서 끌어낸 규칙이다.
- **messaging 마이그레이션 두 leaf가 같은 디렉터리에서 V2를 둘 만들었다**
같은 형태가 다른 가족에서 나타난 사례다.
## 문제
알림 플랫폼의 마이그레이션은 자기 디렉터리에 있었다. 기본 Flyway 위치는 다른 디렉터리였다.
그래서 아무것도 그 마이그레이션을 적용하지 않았다.
## 결론
명백해 보이는 수정이 더 나쁜 결함을 만들었을 것이다.
디렉터리를 기본 위치 목록에 더하면 두 트리가 히스토리 테이블을 공유한다. 두 트리 모두 V1 부터 번호를 매기므로, 두 개의 V1 이 같은 버전이 된다.
Flyway 의 반응은 둘 중 하나다. 두 번째를 거절하거나, 해석 순서에 따라 하나를 기록하고 다른 하나를 건너뛴다.
첫 번째는 시끄러운 실패라 발견된다. 두 번째는 조용하다. 어떤 배포는 알림 테이블을 갖고 어떤 배포는 갖지 않으며, 둘 다 마이그레이션 성공을 보고한다.
수정은 별도 스트림이었다. 자기 위치와 자기 히스토리 테이블을 갖는다.
그 결과 능력의 선택 가능성이 스키마 수준에서 성립한다. 알림을 켜지 않은 배포에는 알림 히스토리 테이블도 알림 테이블도 없고, 나중에 켜면 자기 V1 부터 적용한다.
## 검증 환경
데이터베이스 : PostgreSQL
마이그레이션 도구 : Flyway
확인 방식 : javadoc 의 사후 기록과 현재 상수 확인
소스 수정 : x
## 재현 조건
1. 알림 스키마 스트림 클래스의 javadoc 을 읽는다. 두 트리의 충돌과 Flyway 의 두 가지 반응이 적혀 있다.
2. 현재 위치 상수와 히스토리 테이블 상수를 확인한다.
3. 기본 Flyway 위치와 비교한다.
## 본문
<!-- body:start -->
notification 마이그레이션이 `db/migration/jpa/notification-platform`에 있는데 primary location은 `db/migration/postgresql`이라 **아무것도 적용하지 않았다.**
## 마이그레이션 위치와 primary location
:::evidence key="two-trees-both-numbered-from-v1" alt="분석 문서 final/document.md 에서 이 기록의 근거 절을 그대로 잘라낸 18줄. 코드베이스를 측정한 것이 아니라 원본 판정이 무엇을 적었는지를 보여 준다." caption="final/document.md 발췌 — 18줄" zoom="true"
:::
## 디렉터리를 목록에 추가하는 해법이 틀린 이유
`V1__notification_platform_core``V1__initial_schema`가 같은 버전이 되기 때문이다.
## 실제 해법이 capability 를 optional 하게 만든다
독립 스트림 + 자기 history 테이블이고, 그것이 capability를 진짜로 optional하게 만든다.
## 확인하지 못한 것
두 트리를 한 히스토리에 병합해 건너뛰기를 재현하지 않았다. 이 기록은 javadoc 의 사후 기록에 근거한다.
없음
<!-- body:end -->