meilisearch/milli/src
bors[bot] 0a301b5f88
Merge #723
723: Fix bug in handling of soft deleted documents when updating settings r=Kerollmops a=loiclec

# Pull Request

## Related issue
Fixes (partially, until merged into meilisearch) https://github.com/meilisearch/meilisearch/issues/3021

## What does this PR do?
This PR fixes the bug where a `missing key in documents database` internal error message could appear when indexing documents.

When updating the settings, before clearing the database and before creating the transform output, we now modify the `ExternalDocumentsIds` structure to get rid of all references to soft deleted document ids in its FSTs.

It used to be that updating the settings would clear the soft-deleted document ids, but keep the original `ExternalDocumentsIds` structure. As a consequence of this, when processing a future document addition, we could wrongly believe that a document was being replaced when, in fact, it was a completely new document. See the tests `bug_3021_first`, `bug_3021_second`, and `bug_3021` for a minimal test case that would have reproduced the issue.
 
We need to take special care to:
- evaluate how users should update to v0.30.1 (containing this fix): dump? reimporting all documents from scratch?
- understand IF/HOW this bug could have caused duplicate documents to be returned 
- and evaluate the correctness of the fix, of course :)


Co-authored-by: Loïc Lecrenier <loic.lecrenier@me.com>
2022-12-06 14:37:38 +00:00
..
documents Fixes for clippy bringing us down to 18 remaining issues. 2022-10-25 20:49:02 +02:00
facet update milli with the new parser_filter 2021-11-04 15:02:36 +01:00
heed_codec Merge #659 2022-11-03 15:24:38 +00:00
search Update milli/src/search/facet/filter.rs 2022-12-05 20:56:21 +01:00
snapshots/index.rs/initial_field_distribution Refactor snapshot tests 2022-08-10 15:53:46 +02:00
update Cargo fmt >:-( 2022-12-06 15:22:10 +01:00
asc_desc.rs Fixes for clippy bringing us down to 18 remaining issues. 2022-10-25 20:49:02 +02:00
criterion.rs Improves ranking rules error message 2022-05-20 21:25:43 +02:00
error.rs Introduce an indexation abortion function when indexing documents 2022-10-17 17:28:03 +02:00
external_documents_ids.rs Fix bug in handling of soft deleted documents when updating settings 2022-12-06 15:09:19 +01:00
fields_ids_map.rs Fixes for clippy bringing us down to 18 remaining issues. 2022-10-25 20:49:02 +02:00
index.rs Fix bug in handling of soft deleted documents when updating settings 2022-12-06 15:09:19 +01:00
lib.rs feat: Re-export Span and Token to milli:: 2022-12-03 13:37:33 -05:00
proximity.rs Remove limit of 1000 position per attribute 2021-10-12 10:10:50 +02:00
snapshot_tests.rs Improve insta-snap of the external document ids 2022-12-05 10:51:02 +01:00