Repository navigation
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.
요약
조회마다 원본 로그를 남기고, 매일 새벽 전날 로그와 집계를 비교해 누락률을 기록하고 집계를 로그 기준으로 보정한다. 실시간 비동기 증가는 그대로 유지한다.
What — 무엇을 바꿨나
PlaceViewLog(place_view_log) 추가: 상세 조회 시 요청 트랜잭션에서 동기 적재ViewCountReconciliationService추가: 날짜별로 로그와daily_view_count를 비교해 보정ViewCountReconciliationScheduler추가: 매일 04:00(KST) 실행, 밀린 날짜 처리, Discord 알림, 60일 지난 로그 삭제ViewCountReconciliation(view_count_reconciliation) 추가: 날짜별 검증 결과 기록ViewCountReconciliationProperties추가 (app.view-count.reconciliation)sql/view_count_reconciliation.sql추가Why — 왜 필요한가
지금은
@Async증가만 있어서 스레드 풀 포화, 비동기 예외, 서버 종료나 크래시 때 카운트가 조용히 유실된다. 원본 데이터가 없으니 얼마나 빠지는지 측정할 수 없고 재집계도 할 수 없다. 또 같은 날 첫 조회가 동시에 들어오면daily_view_count행이 중복으로 생긴다.How — 어떻게 구현했나
delta = 로그 − 집계를 구한다place.view_count에 반영한다@Transactionalself-invocation 문제를 피한다체크리스트
./gradlew build, 66개 통과)관련 이슈
기타 / 리뷰 포인트
sql/view_count_reconciliation.sqlDDL을 수동으로 적용해야 한다 (ddl-auto: validate라 테이블이 없으면 기동 실패)validate기동으로 확인하지 못했다/admin/**인증이 정비된 뒤 별도로 다룬다