This repository has been archived by the owner on Apr 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 82
Fix hard-deletion of an external id that was soft-deleted and then reimported - main #750
Merged
Conversation
This file contains 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
loiclec
added
bug
Something isn't working
no breaking
The related changes are not breaking (DB nor API)
labels
Dec 19, 2022
3 tasks
irevoire
previously approved these changes
Dec 19, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're good to go 👍
But I believe you'll need to rewrite some of your tests since I merged this PR: #747
That update the way the index.index_documents_config
works sorry 😬
loiclec
changed the title
Fix hard-deletion of an external id that was soft-deleted
Fix hard-deletion of an external id that was soft-deleted and then reinserted
Dec 20, 2022
loiclec
changed the title
Fix hard-deletion of an external id that was soft-deleted and then reinserted
Fix hard-deletion of an external id that was soft-deleted and then reimported
Dec 20, 2022
loiclec
force-pushed
the
fix-bug-3021-again
branch
from
December 20, 2022 14:35
9b159f0
to
fc0e738
Compare
loiclec
changed the title
Fix hard-deletion of an external id that was soft-deleted and then reimported
Fix hard-deletion of an external id that was soft-deleted and then reimported -main
Dec 20, 2022
loiclec
changed the title
Fix hard-deletion of an external id that was soft-deleted and then reimported -main
Fix hard-deletion of an external id that was soft-deleted and then reimported - main
Dec 20, 2022
irevoire
approved these changes
Dec 20, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot; that's way better than the first implementation we thought of initially!
bors merge
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
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.
Pull Request
Related issue
Fixes (when merged into meilisearch) meilisearch/meilisearch#3021
What does this PR do?
There was a bug happening when:
Then, search results would return duplicate documents. No crash would happen at any time (this is the reason it wasn't caught by the previous fuzz test. I have updated the new one such that it also checks the result of a placeholder search request, which then finds the bug immediately).
The cause of the bug is:
ExternalDocumentsIds
structure.Implementation of the fix
ExternalDocumentsIds
, we can simply call thedelete_soft_deleted_documents_ids_from_fsts
method, which is faster and simpler.Correctness
A unit test was added to reproduce the bug. The new fuzz test, when adjusted to check the correctness of a placeholder search, could also instantly reproduce the bug, but now does not find any other problem.