Use delete_by_query to remove all duplicate favorite documents#1458
Open
oalders wants to merge 1 commit into
Open
Use delete_by_query to remove all duplicate favorite documents#1458oalders wants to merge 1 commit into
oalders wants to merge 1 commit into
Conversation
Member
Author
|
I should note that I'm not sure why author keys need to be purged, but the previous code already did this. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1458 +/- ##
==========================================
+ Coverage 62.16% 62.22% +0.06%
==========================================
Files 137 137
Lines 4393 4400 +7
Branches 659 658 -1
==========================================
+ Hits 2731 2738 +7
- Misses 1410 1412 +2
+ Partials 252 250 -2
🚀 New features to boost your workflow:
|
00b03d9 to
93cb804
Compare
Prod has cases where duplicate favorite documents exist for the same (user, distribution) pair with different authors -- I don't know exactly why this is. The previous delete handler used get(), which computes a single composite ID, deletes one document and leaves orphans behind. This is possibly why users sometimes reported removing a ++ but not actually being able to delete it. Switch to search + delete_by_query to remove all matching documents and purge cache keys for every affected author.
93cb804 to
eb60c1f
Compare
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.
Prod has cases where duplicate favorite documents exist for the same
(user, distribution) pair with different authors -- I don't know exactly
why this is. The previous delete handler used get(), which computes a
single composite ID, deletes one document and leaves orphans behind.
This is possibly why users sometimes reported removing a ++ but not
actually being able to delete it. Switch to search + delete_by_query to
remove all matching documents and purge cache keys for every affected
author.