Files
document-haness/docs/clean-architecture-backend-template/final/evidence/raw/a06-f016-flamingock.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

74 lines
3.9 KiB
Plaintext

# 펜스 메서드가 돌려주는 값과 그 javadoc
/**
* Unfenced: the engine's lock exposes no monotonic token.
*
* <p>Reported honestly rather than synthesised from a local counter, which would look like
* fencing and protect nothing — a per-process counter says nothing about what another process
* acquired. The runner refuses resumable migrations under an unfenced lease for exactly this
* reason.
*/
@Override
public long fence() {
return UNFENCED;
}
# 실행자의 진입점이 지나는 세 관문
Objects.requireNonNull(context, "context");
if (!lock.held()) {
throw MongoOperationRejectedException.of(
"migration.lock",
"the migration lease is not held; only one runner may apply changes at a time");
}
migrations.forEach(this::validate);
if (lock.fence() == MongoMigrationLock.UNFENCED) {
// An unfenced lease cannot tell a live runner from a stalled one that is about to wake up.
// Refused rather than downgraded: the alternative is a certification that says "one runner at
// a time" and a mechanism that cannot show it.
throw MongoOperationRejectedException.of(
"migration.fence",
"this migration lease exposes no fencing token, so a stalled runner cannot be excluded;"
+ " use a fenced lease or run the migration inside a maintenance window with the"
+ " application stopped");
}
return migrations.stream()
# 그 파일에서 리스의 펜스를 읽는 곳 전수
80: migrations.forEach(this::validate);
82: if (lock.fence() == MongoMigrationLock.UNFENCED) {
93: return migrations.stream()
154: result.resumePoint().ifPresent(checkpoint -> ledger.saveCheckpoint(checkpoint, lock.fence()));
157: migration.id(), migration.checksum(), context.operator(), clock.instant(), lock.fence());
# 154행이 넘기는 곳과 157행이 넘기는 곳이 그 값을 다루는 방식
93: requireCurrentFence(fence, "ledger entry for " + migrationId.value());
120: requireCurrentFence(fence, "checkpoint for " + checkpoint.migrationId().value());
177: private static void requireCurrentFence(long fence, String what) {
if (fence == MongoMigrationLock.UNFENCED) {
throw MongoOperationRejectedException.of(
"migration.fence",
"refusing to write the "
# 마이그레이션이 재개 가능한지 실행 전에 알 수 있는가
17: MongoMigrationId id();
20: MongoMigrationChecksum checksum();
23: MongoMigrationPrecondition precondition();
26: MongoMigrationResult execute(MongoMigrationContext context);
29: MongoMigrationPostcondition postcondition();
# 이 잠금 어댑터가 나오는 곳 전수
test/java/dev/caskeleton/adapter/outbound/mongo/migration/flamingock/FlamingockMongoMigrationAdapterTest.java:58: assertThatThrownBy(() -> new FlamingockLockAdapter(() -> false, extension -> {}, () -> {}))
test/java/dev/caskeleton/adapter/outbound/mongo/migration/flamingock/FlamingockMongoMigrationAdapterTest.java:65: FlamingockLockAdapter lock =
test/java/dev/caskeleton/adapter/outbound/mongo/migration/flamingock/FlamingockMongoMigrationAdapterTest.java:66: new FlamingockLockAdapter(() -> true, extension -> {}, () -> released.set(true));
main/java/dev/caskeleton/adapter/outbound/mongo/migration/flamingock/FlamingockLockAdapter.java:17:public final class FlamingockLockAdapter implements MongoMigrationLock {
main/java/dev/caskeleton/adapter/outbound/mongo/migration/flamingock/FlamingockLockAdapter.java:25: public FlamingockLockAdapter(
# 실행자와 원장과 잠금을 프로덕션에서 참조하는 곳
(없음)
# 마이그레이션을 적용하는 진입점 전수
test/java/dev/caskeleton/adapter/outbound/mongo/migration/MongoMigrationLaneTest.java:81: List<MongoMigrationResult> results =
main/java/dev/caskeleton/adapter/outbound/mongo/migration/MongoMigrationRunner.java:69: public List<MongoMigrationResult> apply(