diff --git a/app/models/published.py b/app/models/published.py index fe6db50..f855703 100644 --- a/app/models/published.py +++ b/app/models/published.py @@ -56,7 +56,7 @@ class PublishOutbox(Base): DateTime(timezone=True), default=datetime.now, nullable=False ) processed_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True)) - # mig377: 행별 격리 재시도/terminal. attempts=savepoint 실패 누적, failed_at=MAX 초과 terminal + # mig378: 행별 격리 재시도/terminal. attempts=savepoint 실패 누적, failed_at=MAX 초과 terminal # (set 시 워커 select 에서 제외 → head-of-line block 방지). attempts: Mapped[int] = mapped_column(SmallInteger, nullable=False, default=0) failed_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True)) diff --git a/migrations/377_publish_outbox_attempts_failed.sql b/migrations/378_publish_outbox_attempts_failed.sql similarity index 80% rename from migrations/377_publish_outbox_attempts_failed.sql rename to migrations/378_publish_outbox_attempts_failed.sql index f55387d..28abfff 100644 --- a/migrations/377_publish_outbox_attempts_failed.sql +++ b/migrations/378_publish_outbox_attempts_failed.sql @@ -1,4 +1,5 @@ --- 377_publish_outbox_attempts_failed.sql +-- 378_publish_outbox_attempts_failed.sql +-- (번호: 멀티세션 중 prod 가 377_domain_bucket 을 선점 → 378 로 리넘버.) -- publish_outbox poison row head-of-line block 차단. 발행 워커가 행별 savepoint 격리 후 -- 예외 시 attempts++ 하고 MAX 초과 시 failed_at 스탬프(terminal) → 그 행을 select 에서 제외해 -- 후속 발행이 막히지 않게 함. 기존 미처리 행은 attempts=0 / failed_at=NULL 로 정상 재처리.