Repository navigation
fix: 인기도 정규화 기준과 동점 정렬 보정 - #814
Merged
Merged
Conversation
주간 조회수 분모가 50이라 한 주에 50회만 넘으면 관심도 점수가 만점으로 묶이고, 동점은 id 오름차순으로 풀려서 조회수가 더 많은 주류보다 id가 작은 주류가 앞에 섰다. 10월 18일 하루 급증한 242번이 두 주 연속 1위로 노출된 원인이다. - 운영 분포(2026-10-27)를 기준으로 단위별 분모를 재설정한다 - 인기 목록 정렬에 원시 조회수 내림차순을 두 번째 기준으로 넣는다 - 테스트 팩토리에 원시 조회수를 지정하는 Snapshot 생성 오버로드를 추가한다
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.
배경
/api/v1/popular/view/week에서 242번(글렌피딕 21년 윈터 스톰 배치 3)이 두 주 연속 1위로 노출되어 운영 DB를 확인했다. 관측 데이터 누적과 배치 실행은 정상이었고, 원인은 순위 산정 방식에 있었다.alcohol.id오름차순이라 조회수가 더 많은 주류(8972번, 105회)보다 id가 작은 242번이 앞에 섰다.2026-10-27 기준 주간 스냅샷 분포는 다음과 같다.
변경
bottlenote-batch/src/main/resources/application.yml: 단위별 정규화 분모를 운영 분포 기준으로 재설정했다. 다음 롤업부터 반영되며 과거 스냅샷은 바꾸지 않는다.CustomPopularQueryRepositoryImpl: 주간 인기, 주간·월간 관심도 목록의 정렬을 점수 내림차순 → 원시 조회수 내림차순 → id 오름차순으로 바꿨다. 봄 추천(랜덤)은 그대로다.AlcoholTestFactory: 원시 조회수를 직접 지정하는persistPopularitySnapshot오버로드를 추가했다. 기존 시그니처는 그대로 위임한다.PopularitySnapshotConsumerIntegrationTest: 점수가 같을 때 조회수가 많은 주류가 먼저 나오는지 확인하는 테스트 2건을 추가했다.같은 방문자의 반복 조회 중복 제거는 Redis 구조 변경이 필요해 이 PR 범위에서 제외했다. 이번 변경 후 몇 주 분포를 보고 별도로 진행한다.
검증
./gradlew :bottlenote-batch:test --tests PopularityObservationPropertiesTest: 통과./gradlew :bottlenote-product-api:integration_test --tests PopularitySnapshotConsumerIntegrationTest: 5건 통과 (신규 2건 포함, TestContainers)