Enqueue for reindexing after commit

Description

Now that the PR for has added the gem after_commit_everywhere, we can reduce the number of stale data issues in Resque by having IndexQueue always queue items for reindexing after commit, to ensure that Resque won't be trying to look up information from the database before it's been committed.

In cases where the existing reindex callbacks don't need to check what changes were made to a record (e.g. via saved_change_to_x? and previous_changes, etc.) we can also change the callbacks from after_update to after_commit.

Similar to AO3-5940, which addresses the same issue for mailers.

How to test: TBD.

Activity

Sarken 
October 29, 2020 at 3:12 AM

From coaldustcanary in Support, an issue that might be related to this or AO3-5290:

we're getting a steady number (a few per day) of tickets where a work is posted and it appears on a user's dash but nowhere else, including the creator's works page like it failed to index at all. I'm also seeing mentions of it in the wild (tumblr, reddit, and discord). Reindexing fixes it, editing fixes it, and we've seen these occasionally for a while but there are definitely more the past couple weeks.

Details

Assignee

Reporter

Roadmap

Bookmarks
Pseuds
Search
Works

Priority

Affects versions

Components

BackEnd

Difficulty

Milestone

Sentry

Created April 29, 2020 at 9:47 PM
Updated February 19, 2025 at 10:54 PM