Files
document-haness/docs/clean-architecture-backend-template/tech-log-studio/transaction-and-consistency-models/concept/concept-adapter-outbound-cache-redis-c13.md
T
DongHyeonkaandClaude Fable 5.1 b25357c48a docs(clean-architecture-backend-template): fold analysis into final and re-select one topic
- analysis/·source-index·state.json 을 final/document.md 제2부·제3부로 접었다. SSOT 는 하나다
- 파일럿 — commit-ambiguity-as-a-result 를 새 기준으로 재선별. 후보 14 → 글감 5
  (PROMOTE 5 · MERGE_INTO 3 · KEEP_IN_SSOT 4 · 보류 2). 기록 5건을 다시 썼고 그림 1개를
  techviz 로 만들었다
- 재선별이 잡은 것: 제1부 §6.2·§11.1 이 자기 §13.2 와 어긋나 있었다(레인을 안 돌렸다 vs
  돌렸다) — 정정. 이미 답이 나와 있던 Question 을 HEAD 재실행 질문으로 다시 세웠다.
  Concept 이 인용한 코드가 SSOT 에 없어 뺐다
- candidateScope·sourceRepository 기록. 나머지 43개 주제는 재선별 대기(PENDING 905)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-07 12:39:20 +09:00

54 lines
3.2 KiB
Markdown

---
kind: CONCEPT
slug: adapter-outbound-cache-redis-c13
title: 등록되지 않은 스크립트는 서버에 닿을 방법이 없다
topic: transaction-and-consistency-models
project: clean-architecture-backend-template
status: 게시 전
sourceRevision: 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916
rootTreeNode: concept:adapter-outbound-cache-redis-c13
evidenceCapturedOn: 2026-09-01
assets:
- key: adapter-outbound-cache-redis-c13
file: ../../../final/evidence/rendered/adapter-outbound-cache-redis-c13.svg
- key: adapter-outbound-cache-redis-c13-diagram
file: ../../../final/assets/diagrams/adapter-outbound-cache-redis-c13.svg
evidence:
- ../../../final/evidence/raw/adapter-outbound-cache-redis-c13.txt
source:
- 원본 분석 절은 final/document.md#a10#L701 이다.
module: adapter-outbound-cache-redis
---
# 등록되지 않은 스크립트는 서버에 닿을 방법이 없다
`RedisScriptRegistry`가 등록을 배포 단계로 두고, 트랜잭션 창은 감시 키에서 정한 노드에 고정된다.
## 본문
<!-- body:start -->
`RedisScriptRegistry`의 규칙 — "Registration is a deployment step, not a request-time one. A script that was never registered has no digest and therefore **no way to reach the server**, which is what makes 'only reviewed scripts run' a structural property rather than a convention." 같은 identity에 다른 body를 등록하면 거부하고, 실행 시점에도 body가 등록본과 같은지 다시 본다.
## 등록과 실행의 분리
:::evidence key="adapter-outbound-cache-redis-c13-diagram" alt="배포 시 스크립트 등록과 digest 대조와 EVALSHA 실행이 왼쪽에서 오른쪽으로 이어지는 구조" caption="등록과 실행의 분리" zoom="false"
:::
README가 주장하는 복구 사슬 `EVALSHA → NOSCRIPT → SCRIPT LOAD → digest verify → EVALSHA`**실재한다**`LettuceRedisScriptOperations:26` javadoc이 "NOSCRIPT is the one failure retried automatically"라고 적고, `:129-133``RedisNoScriptException` 또는 메시지 접두 `NOSCRIPT`를 잡아 `:100`에서 `registry.forget(script.id())`를 호출한다. 다음 호출이 `digest(...)`에서 다시 `SCRIPT LOAD`한다.
## RedisScriptRegistry 참조 위치
:::evidence key="adapter-outbound-cache-redis-c13" alt="코드베이스에서 RedisScriptRegistry 를 검색한 출력 7줄. 이 기록이 세는 참조가 그 출력에 그대로 보인다." caption="RedisScriptRegistry 코드베이스 검색 — 7줄 · exit 0" zoom="true"
:::
## Cluster에서 MULTI 창을 노드에 고정하는 방법
`RedisTransactionRunner`는 Cluster에서의 `MULTI` 문제를 정면으로 다룬다. javadoc이 문제와 해법을 적는다 — 다른 레인은 명령마다 슬롯 소유 노드로 라우팅하는데 "that is exactly what a `MULTI` window must not do: the queued commands would be spread across nodes and none of them would be part of the same window." 해법은 연결이 아니라 **라우팅 결정**이었다 — 감시 키(또는 명시적 슬롯 태그)에서 노드를 정해 레인을 고정한다.
## 감시 키가 없는 Cluster 트랜잭션을 거부하는 이유
"the keys the callback will queue are not known until the callback runs, which is after the window is open."
<!-- body:end -->