feat: Outbox 수동 재처리와 감사로그 구현 - #102
Open
hywznn wants to merge 6 commits into
Open
Conversation
REVIEW_REQUIRED 이벤트를 안전하게 PENDING으로 전환하는 도메인 규칙과 재처리 이력·중복 방지 테이블, PostgreSQL tenant 정책을 추가합니다.
사유·expected version·Idempotency-Key를 검증하고 사업장 잠금과 감사로그를 거쳐 Outbox worker에 재처리를 맡기는 운영 API를 구현합니다.
권한, tenant 격리, 상태·버전 충돌, 중복·동시 요청, OpenAPI, PostgreSQL migration과 RLS 정책을 검증하고 운영 절차를 문서화합니다.
최대 재시도 횟수에 도달한 이벤트도 수동 복구 후 Handler가 실행되도록 시도 횟수를 초기화합니다. 초기화 전 횟수는 수동 재처리 이력에 보존하고 실제 Processor 호출까지 통합 테스트합니다.
krestar
previously approved these changes
Aug 6, 2026
krestar
left a comment
Contributor
There was a problem hiding this comment.
커멘트 하나 남긴 부분이 살짝 애매하긴 한데, 나머진 전부 잘 구현된 것 같아서 승인합니다
| @JsonProperty("expected_version") | ||
| @Schema(description = "운영자가 확인한 현재 Outbox event version", example = "3") | ||
| @Min(value = 0, message = "expected_version은 0 이상이어야 합니다.") | ||
| long expectedVersion, |
Contributor
expected_version 누락과 null 요청이 0으로 처리되지 않도록 명시적인 필수 검증을 추가합니다.
# Conflicts: # src/main/java/com/fowoco/server/audit/domain/AuditTargetType.java # src/test/java/com/fowoco/server/PostgreSqlMigrationTests.java # src/test/java/com/fowoco/server/common/security/PostgreSqlRlsIsolationTest.java
hywznn
marked this pull request as ready for review
August 6, 2026 15:29
Contributor
Author
|
CI 에러 무엇이 문제냐 .. infra작업하고 계신건가 |
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.
왜 필요한가요?
반복 실패로
REVIEW_REQUIRED에 멈춘 Outbox 이벤트를 운영자가 DB를 직접 수정하지 않고 안전하게 재처리할 수 있도록 합니다.Refs #54
무엇이 바뀌나요?
POST /api/v1/admin/outbox-events/{eventId}/retry를 추가했습니다.expected_version, 10~300자의 사유,Idempotency-Key를 필수로 받습니다.expected_version누락·null요청은 400으로 거부합니다.REVIEW_REQUIRED이며 lease가 없는 이벤트만PENDING으로 되돌립니다.attempt_count를 0으로 초기화해 Handler가 실제로 다시 실행될 기회를 부여합니다.outbox_manual_retry.previous_attempt_count에 변경 불가 이력으로 보존합니다.API 결과
정상 요청은
202 Accepted를 반환합니다. 필수값 누락은 400, 잘못된 상태·오래된 version·동시 요청은 409로 안전하게 거부됩니다.검증
./gradlew clean test성공병합 순서
#55의 V24·V25 병합 후 이 PR의 V26·V27을 병합해야 하며, 이후 #85의 V28을 병합합니다.