Repository navigation
fix(order): 캠페인 주문 취소에도 capture 펜스를 적용한다 - #447
Merged
Merged
Conversation
- 캠페인 주문 취소와 capture 펜스를 같은 트랜잭션에 기록하고 V59 로 기존 취소 주문을 소급한다. - pg_stat_activity 스냅샷을 비우며 PostgreSQL 경쟁 테스트의 실제 행 잠금 대기를 결정적으로 확인한다. - Playwright로 실제 PayPal Sandbox 승인까지 진행하는 로컬 Toxiproxy 하네스와 실측 결과(EXP-050)를 추가한다. - 검증: clean check 599 tests / 0 failures; Toxiproxy 실제 Sandbox 9/9 capture fault 복구, 각 PayPal capture 1건. Closes #445
- 승인 return 단계에서 Toxiproxy 가 실제로 방해하는 첫 PayPal GET 요청을 조건명과 주석에 명시한다. - capture POST 자체에 장애를 주입한 것처럼 보이는 EXP-050 및 PR 설명을 정정한다. - 검증: Node 구문 검사와 EXP-050 Markdown lint 통과.
- Toxiproxy 가 승인 return 의 첫 PayPal 주문 GET 에 영향을 주며 capture POST 자체는 미주입임을 명시한다. - PayPal 자격 증명·FX 합성 전제를 정확히 기록하고 capture 전용 fault 검증을 #448 후속으로 남긴다. - 검증: EXP-050 Markdown lint 통과.
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.
변경 요청 (Pull Request)
목적
변경 범위
prohibitNewOrderCapture), V59 소급, 경쟁 테스트 결정화, 실제 ATLAS·PostgreSQL·PayPal Sandbox 장애 주입 하네스(start-app.sh,real-flow.mjs)와 실측(EXP-050), D-121.근거와 설계
OrderServiceImpl.cancelLocked는 주문 행을 잠그고CANCEL_PENDING을 기록하지만 결제 시도에 펜스를 남기지 않았다. V58 소급도buyer_checkout만 대상으로 했다.Propagation.MANDATORY로 펜스를 기록한다(잠금 순서 주문 → 결제 시도). 취소가 롤백되면 펜스도 롤백된다. 이미 시작된CAPTURE_PENDING/UNKNOWNcapture는 기존대로 복구한다.checkout_id IS NULL인 결제 시도 중 주문이CANCEL_PENDING/CANCELLED인 행만 대상이다. HTTP API 변경 없음.load-tests/paypal-real-fault/에만 Playwright 1.64.0(devDependency, 로컬 전용)을 둔다.node_modules는 git에서 제외한다. 실행하지 않는 이전 하네스(run.sh,workload.js)는 제거했다.pg_stat_activity스냅샷 때문에 대기를 놓쳤다. 매 조회 전pg_stat_clear_snapshot()을 호출하고, 경쟁 스레드가 막히지 않고 끝나면 즉시 실패하게 했다(연속 3회 통과). 실측은 조건당 3건이고 FX 스냅샷만SYNTHETIC_FIXTURE다. 승인 return 장애는 PayPal 주문 GET에 주입되며, capture POST 자체의 장애 복구로 주장하지 않는다. 이 분리 측정은 #448 후속 작업으로 남긴다.시각화
sequenceDiagram participant B as Buyer cancel (campaign order) participant O as purchase_order row participant A as payment_attempt row participant R as recovery / approval callback B->>O: lock, CANCEL_PENDING B->>A: lock, capture_prohibited=true (same tx) R->>A: reservePhase(CAPTURE) under lock A-->>R: AUTHORIZED + fence → no provider call추적
pg_stat_clear_snapshot)변경 요약
검증
CheckoutCaptureFencePostgresIntegrationTest4건 연속 3회 통과,CheckoutBehaviorTest(주문 취소가 provider 작업보다 먼저 펜스를 기록하는지 순서 검증 포함) 통과. 실제 Sandbox 하네스: 수정 후 기준선·주문 생성·승인 return order-lookup 장애 18/18PAID, PayPal capture 각 1건. 수정 전 order-lookup 지연 3건은 500으로 180초 미수렴../gradlew clean check:./gradlew clean check:BUILD SUCCESSFUL, 599 tests, 0 failures/errors..위험·후속 작업
검토 체크리스트
Closes #N또는Refs #N형식이 plain text임.