Refactor: Mongo데이터 삭제 Outbox 도입 및 k6 부하테스트 스크립트#186
Merged
Conversation
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.
🛰️ Issue Number
🪐 작업 내용
1) 삭제 파이프라인 전환 (Event+Retry -> Transactional Outbox)
기존 AFTER_COMMIT 이벤트 -> @retryable -> 실패 테이블 -> 스케줄러 구조를 제거했습니다.
삭제 의도를 MySQL 트랜잭션 안에서 Outbox row로 기록하고, 워커가 비동기로 Mongo 삭제를 수행하도록 전환했습니다.
상태 전이: OPEN -> PROCESSING -> DONE/FAILED
timeout 복구: PROCESSING 상태 장기 체류 건을 재오픈(requeue)하도록 추가했습니다.
2) 도메인 삭제 경로 통일
Doc / Branch / Commit / Save 삭제 시 eventPublisher.publishEvent(...) 또는 직접 Mongo 삭제를 제거하고,
mongoDeleteOutboxFactory.create(...)로 통일했습니다.
식별 모델(Trigger/Domain/Origin)과 복합 유니크 키 기반으로 dedupe 경계를 명확히 했습니다.
3) 생성 보상(Saga) 경로도 Outbox 기반으로 통일
DocCreate / BranchCreate / CommitCreate / Merge 오케스트레이터에서
실패 보상을 직접 Mongo 삭제 호출이 아닌 COMPENSATE Outbox 적재로 전환했습니다.
4) 경쟁 상황/복구 안정화
유니크 충돌(DataIntegrityViolationException) 시 재조회 fallback을 적용했습니다.
충돌 후 영속성 컨텍스트 부작용 방지를 위해 실패 엔티티 detach 처리 보강했습니다.
테스트에서 드러난 timeout/중복/no-op/배치한도 시나리오를 검증 케이스로 추가했습니다.
5) stg 성능측정 준비(유저 시드 단순화)
TestUserInitializer에 PERF_SEED_USER_COUNT 기반 stg 대량 유저 시드를 추가했습니다.
k6 계정 규칙과 호환되는 이메일 패턴(perfdel_u001@test.com)으로 생성합니다.
6) k6 스크립트 프로젝트 내 포함
perf/deleteseed_dataset.jsdelete_only_benchmark.jscompare_delete_summary.mjsperf/single_deletesingle_user_delete_benchmark.jscompare_single_delete_summary.mjsseed_users.sh제거 (초기화 로직으로 대체)📚 Reference
PERF_SEED_USER_COUNT=100(예시)✅ Check List