This repository was archived by the owner on Apr 4, 2023. It is now read-only.
Commit 97fb64e
Merge #747
747: Soft-deletion computation no longer depends on the mapsize r=irevoire a=dureuill
# Pull Request
## Related issue
Related to meilisearch/meilisearch#3231: After removing `--max-index-size`, the `mapsize` will always be unrelated to the actual max size the user wants for their DB, so it doesn't make sense to use these values any longer.
This implements solution 2.3 from meilisearch/meilisearch#3231 (comment)
## What does this PR do?
### User-visible
- Soft-deleted are no longer deleted when there is less than 10% of the mapsize available or when they take more than 10% of the mapsize
- Instead, they are deleted when they are more soft deleted than regular documents, or when they take more than 1GiB disk space (estimated).
### Implementation standpoint
1. Adds a `DeletionStrategy` struct to replace the boolean `disable_soft_deletion` that we had up until now. This enum allows us to specify that we want "always hard", "always soft", or to use the dynamic soft-deletion strategy (default).
2. Uses the current strategy when deleting documents, with the new heuristics being used in the `DeletionStrategy::Dynamic` variant.
3. Updates the tests to use the appropriate DeletionStrategy whenever needed (one of `AlwaysHard` or `AlwaysSoft` depending on the test)
Note to reviewers: this PR is optimized for a commit-by-commit review.
## PR checklist
Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?
Thank you so much for contributing to Meilisearch!
Co-authored-by: Louis Dureuil <louis@meilisearch.com>
Co-authored-by: Tamo <tamo@meilisearch.com>File tree
49 files changed
+177
-129
lines changed- milli/src
- update
- facet
- index_documents
- prefix_word_pairs
- snapshots/delete_documents.rs
- delete_documents_with_numbers_as_primary_key
- always_hard
- always_soft
- delete_documents_with_strange_primary_key
- always_hard
- always_soft
- filtered_placeholder_search_should_not_return_deleted_documents
- always_hard
- always_soft
- geo_filtered_placeholder_search_should_not_return_deleted_documents
- always_hard
- always_soft
- get_documents_should_not_return_deleted_documents
- always_hard
- always_soft
- search_should_not_return_deleted_documents
- always_hard
- always_soft
- stats_should_not_return_deleted_documents
- always_hard
- always_soft
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
49 files changed
+177
-129
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1192 | 1192 | | |
1193 | 1193 | | |
1194 | 1194 | | |
1195 | | - | |
1196 | | - | |
| 1195 | + | |
| 1196 | + | |
1197 | 1197 | | |
1198 | 1198 | | |
1199 | 1199 | | |
| |||
1282 | 1282 | | |
1283 | 1283 | | |
1284 | 1284 | | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
1285 | 1296 | | |
1286 | 1297 | | |
1287 | 1298 | | |
| |||
1487 | 1498 | | |
1488 | 1499 | | |
1489 | 1500 | | |
1490 | | - | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
1491 | 1504 | | |
1492 | 1505 | | |
1493 | 1506 | | |
| |||
1657 | 1670 | | |
1658 | 1671 | | |
1659 | 1672 | | |
1660 | | - | |
| 1673 | + | |
| 1674 | + | |
1661 | 1675 | | |
1662 | 1676 | | |
1663 | 1677 | | |
| |||
1726 | 1740 | | |
1727 | 1741 | | |
1728 | 1742 | | |
1729 | | - | |
| 1743 | + | |
1730 | 1744 | | |
1731 | 1745 | | |
1732 | 1746 | | |
| |||
1795 | 1809 | | |
1796 | 1810 | | |
1797 | 1811 | | |
1798 | | - | |
| 1812 | + | |
1799 | 1813 | | |
1800 | 1814 | | |
1801 | 1815 | | |
| |||
1867 | 1881 | | |
1868 | 1882 | | |
1869 | 1883 | | |
| 1884 | + | |
1870 | 1885 | | |
1871 | 1886 | | |
1872 | 1887 | | |
| |||
1891 | 1906 | | |
1892 | 1907 | | |
1893 | 1908 | | |
1894 | | - | |
1895 | | - | |
1896 | | - | |
1897 | | - | |
1898 | | - | |
| 1909 | + | |
1899 | 1910 | | |
1900 | 1911 | | |
1901 | 1912 | | |
| |||
1936 | 1947 | | |
1937 | 1948 | | |
1938 | 1949 | | |
1939 | | - | |
1940 | | - | |
1941 | | - | |
1942 | | - | |
1943 | | - | |
| 1950 | + | |
1944 | 1951 | | |
1945 | 1952 | | |
1946 | 1953 | | |
| |||
1987 | 1994 | | |
1988 | 1995 | | |
1989 | 1996 | | |
| 1997 | + | |
1990 | 1998 | | |
1991 | 1999 | | |
1992 | 2000 | | |
| |||
2011 | 2019 | | |
2012 | 2020 | | |
2013 | 2021 | | |
2014 | | - | |
2015 | | - | |
2016 | | - | |
2017 | | - | |
2018 | | - | |
| 2022 | + | |
2019 | 2023 | | |
2020 | 2024 | | |
2021 | 2025 | | |
| |||
2116 | 2120 | | |
2117 | 2121 | | |
2118 | 2122 | | |
| 2123 | + | |
2119 | 2124 | | |
2120 | 2125 | | |
2121 | 2126 | | |
| |||
2142 | 2147 | | |
2143 | 2148 | | |
2144 | 2149 | | |
2145 | | - | |
2146 | | - | |
2147 | | - | |
2148 | | - | |
2149 | | - | |
| 2150 | + | |
2150 | 2151 | | |
2151 | 2152 | | |
2152 | 2153 | | |
| |||
2158 | 2159 | | |
2159 | 2160 | | |
2160 | 2161 | | |
2161 | | - | |
| 2162 | + | |
2162 | 2163 | | |
2163 | 2164 | | |
2164 | 2165 | | |
| |||
0 commit comments