Skip to content

[Chore] 스캔 파이프라인 안정화 — 트랜잭션 분리 , 멱등 처리, AI 연동 계약 전환 (#44) - #47

Merged
xYunaL merged 8 commits into
devfrom
chore/#44
Sep 11, 2026
Merged

xYunaL merged 8 commits into
devfrom
chore/#44

Conversation

@xYunaL

@xYunaL xYunaL commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

🔗 Related Issue

📝 Summary

  • AI repo의 CLOVA OCR 전환에 맞춰 백엔드 스캔 파이프라인을 수정
  • 외부 호출이 DB 커넥션을 점유하던 구조를 분리
  • 중복 스캔, 유실 세션, AI 결과 불일치 해결

🚀 Key Changes

트랜잭션 · 동시성

  • ScanProcessor@Transactional 제거, 상태 전이를 ScanStateWriter로 위임
  • 스캔 전용 scanTaskExecutor 분리
    • AI 서비스 동시 처리 한도 2

데이터 정합성

  • storage_key 기준 멱등 처리 + 부분 고유 인덱스 (V2 마이그레이션)
  • 유실 PROCESSING 세션 주기적 회수 (StaleScanRecovery)

AI 연동 계약

  • Presigned URL → S3 객체 키·버전·ETag 전달로 전환
    • AI가 IAM으로 직접 조회, presigned URL은 fallback으로만 유지
    • 업로드 티켓에 서명된 헤더(uploadHeaders) 포함

💥 Breaking Changes

  • POST /api/v1/uploads/sas 응답에 uploadHeaders 추가
  • GET /api/v1/scans/{id} 응답에 failureCode 추가

배포 순서

운영에서는 presigned URL fallback 꺼져있음.

  1. terraform apply
  2. AI 저장소 배포
  3. backend 저장소 배포
  4. 실제 메뉴판 1장으로 업로드 → 스캔 → 결과 폴링 smoke test

@xYunaL xYunaL self-assigned this Sep 11, 2026
@xYunaL
xYunaL merged commit 69b5484 into dev Sep 11, 2026
1 check passed
@xYunaL
xYunaL deleted the chore/#44 branch September 11, 2026 22:58
@xYunaL xYunaL changed the title Chore: 스캔 파이프라인 안정화 — 트랜잭션 분리 , 멱등 처리, AI 연동 계약 전환 (#44) [Chore] 스캔 파이프라인 안정화 — 트랜잭션 분리 , 멱등 처리, AI 연동 계약 전환 (#44) Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CHORE] AI 서비스: Azure 제거 — CLOVA OCR, OpenAI로 전환

1 participant