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>
15 lines
6.4 KiB
JSON
15 lines
6.4 KiB
JSON
{
|
|
"assetKey": "a05-f025-filequotaservice-commit-postgres",
|
|
"kind": "terminal",
|
|
"command": "set -e\nmkdir -p /tmp/probe\nCT=quota-expiry-probe\ndocker rm -f \"$CT\" >/dev/null 2>&1 || true\ndocker run -d --name \"$CT\" --network \"container:workmachine\" \\\n -e POSTGRES_PASSWORD=probe -e POSTGRES_USER=probe -e POSTGRES_DB=probe \\\n postgres:16-alpine -p 55432 >/dev/null\nfor i in $(seq 1 40); do\n docker inspect -f '{{.State.Running}}' \"$CT\" | grep -q true || { echo '컨테이너가 뜨지 않았다'; exit 1; }\n docker exec \"$CT\" pg_isready -U probe -p 55432 >/dev/null 2>&1 && break\n sleep 1\ndone\ndocker exec \"$CT\" psql -U probe -p 55432 -d probe -tAc 'select version()' | cut -c1-24\nM=adapter/outbound/persistence-jpa/src/main/resources/db/migration\nfor d in postgresql jpa/core jpa/fileserver; do\n for f in $(ls \"$M/$d\"/V*.sql | sort -V); do\n docker exec -i \"$CT\" psql -U probe -p 55432 -d probe -q -v ON_ERROR_STOP=1 < \"$f\" >/dev/null 2>&1 || true\n done\ndone\necho -n '# 쿼터 예약 테이블과 그 만료 열: '\ndocker exec \"$CT\" psql -U probe -p 55432 -d probe -tAc \\\n \"select string_agg(column_name, ' ' order by ordinal_position) from information_schema.columns\n where table_schema='public' and table_name='fs_quota_reservation' and column_name in ('status','expires_at','committed_bytes')\"\n\necho\necho '# 저장소의 두 질의를 만료된 예약에 그대로 돌린다'\ncat > /tmp/probe/cp.sh <<'CPSH'\n# 락파일의 한 구성에 실린 좌표 전부를 캐시 경로로 바꾼다. Gradle 실행 없이 재현된다.\nLOCK=${1:-adapter/outbound/persistence-jpa/gradle.lockfile}\nCONF=${2:-postgresqlIntegrationTestRuntimeClasspath}\nCACHE=/root/.gradle/caches/modules-2/files-2.1\ncp=\"\"\nwhile IFS= read -r line; do\n coord=${line%%=*}; confs=${line#*=}\n case \",$confs,\" in *\",$CONF,\"*) ;; *) continue ;; esac\n group=${coord%%:*}; rest=${coord#*:}; name=${rest%%:*}; ver=${rest##*:}\n jar=$(find \"$CACHE/$group/$name/$ver\" -name '*.jar' ! -name '*sources*' ! -name '*javadoc*' 2>/dev/null | head -1)\n [ -n \"$jar\" ] && cp=\"$cp:$jar\"\ndone < <(grep -E '^[a-zA-Z0-9._-]+:[^=]+=' \"$LOCK\")\necho \"${cp#:}\"\nCPSH\ncat > /tmp/probe/QuotaExpiryProbe.java <<'JAVA'\nimport java.sql.Connection;\nimport java.sql.DriverManager;\nimport java.sql.ResultSet;\nimport java.sql.Statement;\nimport java.util.UUID;\n\n/** 만료된 예약에 확정 문장을 그대로 돌려 본다. 저장소의 두 질의를 그대로 쓴다. */\npublic class QuotaExpiryProbe {\n\n private static final String EXTEND =\n \"update fs_quota_reservation set reserved_bytes = reserved_bytes + 100,\"\n + \" version = version + 1, updated_at = now()\"\n + \" where reservation_id = ? and status = 'RESERVED' and expires_at > now()\";\n\n private static final String COMMIT =\n \"update fs_quota_reservation set status = 'COMMITTED', committed_bytes = ?,\"\n + \" reserved_bytes = 0, version = version + 1, updated_at = now()\"\n + \" where reservation_id = ? and status = 'RESERVED'\";\n\n public static void main(String[] args) throws Exception {\n try (Connection db = DriverManager.getConnection(\n \"jdbc:postgresql://127.0.0.1:55432/probe\", \"probe\", \"probe\")) {\n UUID id = UUID.randomUUID();\n try (Statement s = db.createStatement()) {\n s.execute(\"delete from fs_quota_reservation\");\n }\n try (var insert = db.prepareStatement(\n \"insert into fs_quota_reservation (reservation_id, scope_type, scope_value,\"\n + \" reserved_bytes, committed_bytes, expires_at, status, version, created_at, updated_at)\"\n + \" values (?, 'NAMESPACE', 'probe', 500, 0, now() - interval '1 hour', 'RESERVED', 0, now(), now())\")) {\n insert.setObject(1, id);\n insert.executeUpdate();\n }\n System.out.println(\"만료된 예약을 하나 만든다 (expires_at = 한 시간 전)\");\n\n try (var extend = db.prepareStatement(EXTEND)) {\n extend.setObject(1, id);\n System.out.println(\"연장 질의가 바꾼 행 : \" + extend.executeUpdate());\n }\n try (var commit = db.prepareStatement(COMMIT)) {\n commit.setLong(1, 600);\n commit.setObject(2, id);\n System.out.println(\"확정 질의가 바꾼 행 : \" + commit.executeUpdate());\n }\n try (Statement s = db.createStatement();\n ResultSet r = s.executeQuery(\n \"select status, committed_bytes from fs_quota_reservation\")) {\n while (r.next()) {\n System.out.println(\"결과 행 : status=\" + r.getString(1)\n + \" committed_bytes=\" + r.getLong(2));\n }\n }\n\n System.out.println();\n System.out.println(\"게이트웨이의 정산 행은 expires_at = now 로 만들어진다\");\n UUID settled = UUID.randomUUID();\n try (var insert = db.prepareStatement(\n \"insert into fs_quota_reservation (reservation_id, scope_type, scope_value,\"\n + \" reserved_bytes, committed_bytes, expires_at, status, version, created_at, updated_at)\"\n + \" values (?, 'NAMESPACE', 'settle', 700, 0, now(), 'RESERVED', 0, now(), now())\")) {\n insert.setObject(1, settled);\n insert.executeUpdate();\n }\n try (var strict = db.prepareStatement(COMMIT + \" and expires_at > now()\")) {\n strict.setLong(1, 700);\n strict.setObject(2, settled);\n System.out.println(\"만료 조건을 붙인 확정이 그 행을 바꾼 수 : \" + strict.executeUpdate());\n }\n }\n }\n}\nJAVA\nCP=\"$(bash /tmp/probe/cp.sh adapter/outbound/persistence-jpa/gradle.lockfile postgresqlIntegrationTestRuntimeClasspath)\"\njavac -encoding UTF-8 -nowarn -cp \"$CP\" -d /tmp/probe /tmp/probe/QuotaExpiryProbe.java\njava -Dstdout.encoding=UTF-8 -cp \"$CP:/tmp/probe\" QuotaExpiryProbe\n\ndocker rm -f \"$CT\" >/dev/null 2>&1 || true",
|
|
"cwd": "/shared/codebase/clean-architecture-backend-template/src",
|
|
"exitCode": 0,
|
|
"executedAt": "2026-09-02T04:56:13+00:00",
|
|
"sourceRevision": "21234e38cdb9a926cbc92bb97a2aee2e4a7d2916",
|
|
"raw": "evidence/raw/a05-f025-filequotaservice-commit-postgres.txt",
|
|
"svg": "evidence/rendered/a05-f025-filequotaservice-commit-postgres.svg",
|
|
"rawSha256": "05de6d67a58858ed5f3796e9d988d147063f1af7d51a23e60187f3ca4723606e",
|
|
"lines": 11,
|
|
"redaction": "none — 탐침 데이터만, 자격증명 없음"
|
|
}
|