Skip to content

fix(pose): binlog_format=STATEMENT 면 기동 거부 — RC 저장 1665 장애를 배포 시점으로 (#276) - #845

Merged
Khyojae merged 1 commit into
mainfrom
fix/r276-binlog-format-guard
Nov 8, 2026
Merged

Khyojae merged 1 commit into
mainfrom
fix/r276-binlog-format-guard

Conversation

@Khyojae

@Khyojae Khyojae commented Nov 8, 2026

Copy link
Copy Markdown
Member

무엇

  • BinlogFormatStartupCheck (새 빈): 기동 때 log_bin=ON 이고 세션 binlog_format=STATEMENT 면 기동을 거부한다. ROW·MIXED·binlog 꺼짐은 통과, MySQL 이 아니면(H2 테스트) 건너뛴다.
  • docs/decisions/r276-lock-root-cause-fix.md §2 ㄴ 표의 «모르는 것» 두 줄을 닫았다.

왜

#276 처방(RC)은 MySQL 8.0 기본값 ROW 에 기대고 있는데, compose·my.cnf 어디에도 적혀 있지 않다. STATEMENT 가 되면 RC 쓰기가 오류 1665 로 거부돼 pose 저장이 전부 실패한다. 데이터가 조용히 깨지는 건 아니지만, 장애가 운동 중인 사용자에게서 처음 드러난다. 이 검사는 그 시점을 배포 순간으로 당긴다.

compose 에 --binlog-format=ROW 를 적는 안은 택하지 않았다. 8.0.34+ 에서 deprecated 경고가 나고, compose 밖(관리형 DB)에서는 효과가 없다.

findById 줄은 코드 대조로 닫았다. 트랜잭션 안 문장 넷(세션 조회·종목 지연 로딩·pose INSERT·last_active_at UPDATE) 모두 RR→RC 로 잃는 보장이 없다. 상세는 문서 표에 있다.

검증

  • 판정 단위 테스트 3/3 · ShadowfitApplicationTests(H2, 건너뜀 경로) 통과
  • BinlogFormatStartupCheckRaceTest(실 MySQL): 기본 ROW 통과 + 전제 재현(STATEMENT + RC 쓰기 = 1665). 로컬에 Docker 가 없어 건너뜀 → CI 에서 확인
  • 로컬 compose: ROW → binlog 형식 확인 — log_bin=true binlog_format=ROW 후 UP. SET GLOBAL binlog_format='STATEMENT' 뒤 재기동 → BeanCreationException 으로 기동 중단. 확인 뒤 ROW 로 복구

🤖 Generated with Claude Code

…장애를 배포 시점으로 (#276)

#276 처방(RC)이 MySQL 8.0 기본값 ROW 에 기대고 있었는데 compose·my.cnf 어디에도 적혀 있지 않았다.
STATEMENT 로 바뀌면 RC 트랜잭션의 쓰기가 1665 로 거부돼 pose 저장이 전부 실패한다.
BinlogFormatStartupCheck 가 기동 때 log_bin=ON · 세션 binlog_format=STATEMENT 면 컨텍스트를 멈춘다
(ROW·MIXED·binlog 꺼짐은 통과, MySQL 이 아니면 건너뜀). compose 에 --binlog-format 을 적는 안은
8.0.34+ deprecated 경고 · compose 밖에선 무효라 택하지 않음(사용자 confirm).

같은 문서의 «findById 도 RC 가 된다 — 확인 안 함» 은 코드 대조로 닫음 — 트랜잭션 안 문장 넷 모두 보장 불변.

검증: 판정 단위 3/3 · H2 컨텍스트 통과(건너뜀 경로). 실 MySQL 테스트(정상 통과 + 전제 1665 재현)는
로컬 Docker 없이 건너뜀 → CI. 로컬 compose 로 기동 확인 — ROW 면 «binlog 형식 확인» 후 UP,
SET GLOBAL binlog_format=STATEMENT 뒤 재기동하면 BeanCreationException 으로 멈춤(확인 뒤 ROW 로 복구).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 50 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9ec2cc5 and 3409ee1.

Files selected for processing: 4

  • backend/src/main/java/com/shadowfit/global/config/BinlogFormatStartupCheck.java
  • backend/src/test/java/com/shadowfit/global/config/BinlogFormatStartupCheckRaceTest.java
  • backend/src/test/java/com/shadowfit/global/config/BinlogFormatStartupCheckTest.java
  • docs/decisions/r276-lock-root-cause-fix.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@Khyojae

Khyojae commented Nov 8, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@Khyojae
Khyojae merged commit 5aca94f into main Nov 8, 2026
2 of 3 checks passed
@Khyojae
Khyojae deleted the fix/r276-binlog-format-guard branch November 8, 2026 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant