Fix[LB-1947]: Track listen count stuck#3669
Open
Swaim-Sahay wants to merge 1 commit intometabrainz:masterfrom
Open
Fix[LB-1947]: Track listen count stuck#3669Swaim-Sahay wants to merge 1 commit intometabrainz:masterfrom
Swaim-Sahay wants to merge 1 commit intometabrainz:masterfrom
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.
Description
This PR fixes an issue where the global track and album listen counts were actively getting stuck and not updating and also corrects a bug computing release group popularity.
Ticket: LB-1947
Problem
Our background system caches a large chunk of listen data so it doesn't have to recalculate it from scratch every day. The problem was that when fresh listen data was imported, the system didn't realize it had been updated so it kept using the old frozen cache forever. Because of this the final listen numbers shown to users never went up. There was also a small bug where the wrong math was being used for release group listen counts.
Solution
Taught the caching system to remember exactly where it got its data from. Now, if it notices that the main data location has changed it knows to throw away the old cache and build a new one. We also pointed the release group counts to the correct calculation.
Changes Made
listenbrainz_spark/schema.py: Added adump_locationfield to keep track of where the data came from.listenbrainz_spark/stats/incremental/incremental_stats_engine.py: Updated the system to check and save thedump_locationso it can detect when new data arrives.listenbrainz_spark/popularity/listens.py: Corrected the query used for calculating release group popularity.listenbrainz_spark/popularity/mlhd.py: Minor update to keep the old code compatible with the newdump_locationtracking.AI Usage