fix: PostgreSQL 업무 상세 조회의 잠금 충돌 수정 - #203
Merged
Merged
Conversation
- 읽기 전용 업무 상세 조회에서 SELECT FOR UPDATE가 실행되어 PostgreSQL이 500 오류를 반환하던 문제를 수정한다. - 업무 상세 조회에는 비잠금 근로자 조회를 사용하고, Task 생성·변경 경로의 행 잠금은 유지하여 근로자 보관과의 동시성 제어가 계속 동작하도록 한다. - PostgreSQL 데모 시드 테스트에 업무 상세 조회 회귀 검증을 추가한다.
krestar
marked this pull request as draft
August 17, 2026 04:49
krestar
marked this pull request as ready for review
August 17, 2026 05:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
왜 필요한가요?
PR #199 에서 근로자 보관과 신규 Task 생성이 동시에 진행될 때의 경합을 막기 위해
WorkerTaskContextReader.findByIdAndCompanyId()에 근로자 행 잠금(FOR UPDATE)이 추가됐습니다.이 메서드는 Task 생성뿐 아니라
TaskWorkflowService.findById()의 업무 상세 조회에서도공유되고 있습니다. 업무 상세 조회는
@Transactional(readOnly = true)트랜잭션이므로,PostgreSQL에서 근로자 대상 업무를 조회하면 다음 오류와 함께 500 응답이 발생합니다.
근로자 보관과 Task 생성 사이의 직렬화는 유지하면서, 읽기 전용 업무 상세 조회에서는
행 잠금을 수행하지 않도록 조회 경로를 분리할 필요가 있습니다.
Related: #199
무엇이 바뀌나요?
WorkerTaskContextReader에 읽기 전용 근로자 컨텍스트 조회를 추가합니다.FOR UPDATE를 실행하지 않습니다.PR #199에서 도입한 근로자 보관과 Task 생성 간 직렬화는 유지됩니다.
읽기 전용 트랜잭션 회귀를 검증합니다.
잠금 범위
검증
git diff --checkDemoSeedPostgreSqlApplicationIntegrationTest통과GET /api/v1/tasks/94000000-0000-0000-0000-000000000003가 200 응답WorkerArchiveIntegrationTest통과영향 범위