-
Notifications
You must be signed in to change notification settings - Fork 508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AO3-6328 Try to fix large tags not updating in uses sort #4637
Conversation
Lines 37 to 46 in 660a67a
Do we know what are the values of TAGGINGS_COUNT_CACHE_DIVISOR, TAGGINGS_COUNT_MIN_TIME and TAGGINGS_COUNT_MAX_TIME on staging? Just to check they were not set to extremes quite different from the defaults to test things, ending up with an abnormally high taggings_count_expiry .
|
@ceithir I just checked and all three are |
I don't think it's the sole source of the current issue, as it only affects tags with a count < 1000, but dropping it here to not forget: |
Out of the blue, I'm wondering if the call to write_taggings_to_redis, and the whole job that goes with it, couldn't be replaced with something straightforward like: if value != taggings_count_cache
# Skipping callback to avoid changing the current in memory object, and cascading side effects in general, as we're in a getter
Tag.where(id: self.id).update_all(taggings_count_cache: value)
self.enqueue_to_index
end What lock/performance issue am I missing here? |
@ceithir I didn't want to try to redesign the tags update code, because I worry about unintended consequences considering the complexity of the various async jobs. If AD&T decides to do so, I think it should be in a separate issue. |
…)" This reverts commit 4cacf7b.
Pull Request Checklist
as the first thing in your pull request title (e.g.
AO3-1234 Fix thing
)until they are reviewed and merged before creating new pull requests.
Issue
https://otwarchive.atlassian.net/browse/AO3-6328 (Second PR)
Purpose
Tries to ensure that when the number of uses of a large tag increases (e.g. when a work is posted), a reindex is triggered. After some investigation, it looks like the cached tag count prevents
write_taggings_to_redis
from being called when the tag has at least 1000 uses (TAGGINGS_COUNT_MIN_CACHE_COUNT
).I am not 100% sure of this approach, which is to remove the old cached count in
after_update
. Another way I believe to be possible is setting thetaggings_count_cache
range in ScheduledTagJob to be a lower value likeTAGGINGS_COUNT_MIN_CACHE_COUNT
. Not sure of the broader implications of these methods.Testing Instructions
See Jira issue.
References
#4632
Credit
weeklies (she/her)