82 lines
3.8 KiB
Markdown
82 lines
3.8 KiB
Markdown
---
|
|
title: blog-topic / distributed-lock-transaction-commit-boundary
|
|
source_type: blog-topic
|
|
status: raw
|
|
related_branches: [feature-distributed-lock-contract]
|
|
related_projects: [ca-tmpl]
|
|
tags: [blog-topic, ca-tmpl, persistence, postgresql, distributed-lock, lock-lease, transaction-isolation]
|
|
created: 2026-07-02
|
|
status_label: ready-for-canonical
|
|
target_audience: backend-engineer
|
|
inspiration_url:
|
|
archive_url:
|
|
---
|
|
|
|
# blog-topic: distributed-lock-transaction-commit-boundary
|
|
|
|
> Layer: `raw/blog-topics/` — 작업 중 나온 블로그 글감 원석. 최종 블로그는 canonical 정제 후 `wiki/blog/`에서 작성한다.
|
|
|
|
## Parent / 부모
|
|
|
|
- [[raw/branch-notes/feature-distributed-lock-contract]] — distributed lock provider와 transaction commit boundary 검증에서 나온 글감.
|
|
|
|
## 트리거 / Trigger
|
|
|
|
- 트리거 유형: `branch-work`
|
|
- 트리거 날짜: 2026-07-02
|
|
- 트리거 연결 노트: [[raw/branch-notes/feature-distributed-lock-contract]]
|
|
|
|
## 글감 / Topic seed
|
|
|
|
- 한 문장 요지: 분산 락에서 `lock.close()`와 DB commit 순서가 잘못 맞물리면 lost update 경계가 생기는 이유를 정리한다.
|
|
- 예상 제목 후보:
|
|
- 분산 락은 언제 풀어야 안전할까
|
|
- lock close와 transaction commit 사이의 위험한 틈
|
|
|
|
## 핵심 주장 후보 / Claim candidates
|
|
|
|
- 사실 후보:
|
|
- branch에 `distributedLockProvider` owner, lock port/JdbcLockRegistry, lease/CME handling, 로컬 검증 항목이 정리되어 있다 — 근거 후보: [[raw/branch-notes/feature-distributed-lock-contract]] section+line `:36`, `:48`, `:341-345`, `:370-384`.
|
|
- 경험 후보:
|
|
- branch 자체에 파생 글감 seed가 여러 개 있으며, lock release와 commit boundary는 기존 raw topic에 exact duplicate가 없다.
|
|
- 의견/해석 후보:
|
|
- 분산 락의 correctness는 "락을 잡았다"보다 "락을 언제까지 잡고 있었는가"에 더 민감하다.
|
|
|
|
## Outline seed
|
|
|
|
1. 락 획득보다 해제가 더 무섭다 — commit 전 unlock은 다른 writer에게 잘못된 신호를 줄 수 있다.
|
|
2. transaction boundary와 lock lifecycle을 같은 그림에 놓기 — DB commit, exception, lease 만료를 함께 본다.
|
|
3. local verification으로 증명할 수 있는 것과 없는 것 — single-node/JDBC lock registry 검증과 multi-node 운영 리스크를 분리한다.
|
|
|
|
## Canonical 전환 후보 / Canonical extraction candidates
|
|
|
|
- `wiki/projects/ca-tmpl/distributed-lock-provider-contract.md` 후보:
|
|
- ca-tmpl distributed lock provider 구현/검증 사실.
|
|
- `wiki/concepts/distributed-lock.md` 후보:
|
|
- lock lease, unlock timing, transaction interaction 일반 개념.
|
|
- 필요한 추가 검증:
|
|
- lock close/commit ordering 테스트와 lease 만료/exception path 검증.
|
|
|
|
## Sources / 근거 후보
|
|
|
|
- [[raw/branch-notes/feature-distributed-lock-contract]] — lock provider와 verification 근거.
|
|
|
|
## 미해결 / Unknown
|
|
|
|
- 아직 확인해야 할 사실: multi-instance 환경에서 검증된 범위.
|
|
- 과장하면 안 되는 부분: local/JDBC lock 검증을 운영 분산 환경 보장으로 표현하지 않는다.
|
|
- 블로그로 쓰기 전에 필요한 canonical 정제: distributed lock project 문서 생성 또는 기존 data-layer 문서에 통합.
|
|
|
|
## Decision / 처리 결정
|
|
|
|
- 액션: `promote-to-canonical`
|
|
- 이유: `wiki/projects/ca-tmpl/data-layer-persistence-cache-outbound.md` 에 distributed lock transaction commit boundary 글감으로 반영했다.
|
|
- 다음 단계: target canonical이 아직 `draft` 이므로 `blogify` 전 review/verify가 필요하다. local/JDBC lock 검증을 운영 분산 환경 보장으로 표현하지 않는다.
|
|
|
|
## Related / 관련
|
|
|
|
- 관련 branch: [[raw/branch-notes/feature-distributed-lock-contract]]
|
|
- 관련 error:
|
|
- 관련 interview prep:
|
|
- derived blog: 생성 전. 생성 시 `wiki/blog/distributed-lock-transaction-commit-boundary-YYYY-MM-DD.md` 후보
|