Skip to content
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

Added action to edited_term to sync posts when a term is edited #1956

Closed

Conversation

brandon-m-skinner
Copy link
Contributor

@brandon-m-skinner brandon-m-skinner commented Nov 5, 2020

Description of the Change

When a term is edited, all related posts should be re-indexed. This is very important when it comes to term-based queries which happen pretty regularly on our platform.

Filters for skipping this process have also been added since at large affected-post counts, things tend to fail. We handle these occurrences in a separate queue system that asynchronously processes indexing jobs.

Props @nickdaugherty
cc @rinatkhaziev @pschoffer @netsuso @parkcityj

Alternate Designs

We didn't consider any other designs.

Benefits

Post data remains consistent with the database which keeps queries returning expected results.

Possible Drawbacks

The default behaviour is problematic when there are a lot of posts affected. We only do this behaviour for 10k or less posts and offload any indexing with counts above that to be processed asynchronously.

Verification Process

We noticed data inconsistencies when comparing posts from the DB against posts from ES when editing terms. After applying these changes, the index and the DB were consistent.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Applicable Issues

Changelog Entry

Added queuing of affected posts on term change. Props @nickdaugherty

@felipeelia
Copy link
Member

Related to #1969 (comment)

@felipeelia
Copy link
Member

Closing in favor of #2603

@felipeelia felipeelia closed this Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants