Commit Graph

1124 Commits

Author SHA1 Message Date
Tamo
c9f89d38e3
Merge branch 'main' into index-swap-error-handling 2022-10-27 18:06:45 +02:00
bors[bot]
d16ea755d8
Merge #2982
2982: Adapt task queries to account for special index swap rules r=irevoire a=loiclec

# Pull Request

## Related issue
Fixes https://github.com/meilisearch/meilisearch/issues/2970 

## What does this PR do?
- Replace the `get_tasks` method with a `get_tasks_from_authorized_indexes` which returns the list of tasks matched by the query **from the point of view of the user**. That is, it takes into consideration the list of authorised indexes as well as the special case of `IndexSwap` which should not be returned if an index_uid is specified or if any of its associated indexes are not authorised.
- Adapt the code in other places following this change
- Add some tests
- Also the method `get_task_ids_from_authorized_indexes` now takes a read transaction as argument. This is because we want to make sure that the implementation of `get_tasks_from_authorized_indexes` only uses one read transaction. Otherwise, we could (1) get a list of task ids matching the query, then (2) one of these task ids is deleted by a taskDeletion task, and finally (3) we try to get the `Task`s associated with each returned task ids, and get a `CorruptedTaskQueue` error.



Co-authored-by: Loïc Lecrenier <loic.lecrenier@me.com>
2022-10-27 14:28:04 +00:00
Loïc Lecrenier
8dd7942656 Cargo fmt 2022-10-27 16:24:09 +02:00
bors[bot]
b76f0ace26
Merge #2993
2993: Reconsider the Windows tests r=irevoire a=Kerollmops

This PR removes the `ignore` cfg on top of a lot of our tests. Now that we reworked the index scheduler we can make them pass again!

Fixes #2038, fixes #1966.

Co-authored-by: Clément Renault <clement@meilisearch.com>
2022-10-27 13:41:04 +00:00
bors[bot]
5b535a82ea
Merge #2991
2991: Update version for the next release (v0.30.0) in Cargo.toml files r=Kerollmops a=meili-bot

⚠️ This PR is automatically generated. Check the new version is the expected one before merging.

Co-authored-by: curquiza <curquiza@users.noreply.github.com>
2022-10-27 13:12:31 +00:00
Clément Renault
e67673bd12
Ingore the dumps v1 test on Windows 2022-10-27 14:34:45 +02:00
Clément Renault
44d6f3e7a0
Reconsider the Windows tests 2022-10-27 13:50:05 +02:00
curquiza
68f80dbacf Update version for the next release (v0.30.0) in Cargo.toml files 2022-10-27 11:35:44 +00:00
Irevoire
4d9e9f4a9d
isolate the search in another task
In case there is a failure on milli's side that should avoid blocking the tokio main thread
2022-10-27 13:12:42 +02:00
Loïc Lecrenier
4f4fc20acf Make clippy happy 2022-10-27 13:00:30 +02:00
Loïc Lecrenier
78ffa00f98 Move index swap error handling from meilisearch-http to index-scheduler
And make index_not_found error asynchronous, since we can't know
whether the index will exist by the time the index swap task is
processed.

Improve the index-swap test to verify that future tasks are not swapped
and to test the new error messages that were introduced.
2022-10-27 11:45:38 +02:00
Loïc Lecrenier
7b93ba40bd Reimplement task queries to account for special index swap rules 2022-10-27 11:44:51 +02:00
Clément Renault
fae17ed590
Enable the authentication tests on Windows again 2022-10-27 11:35:24 +02:00
Clément Renault
7e355958e0
Await the last insert task 2022-10-27 11:35:24 +02:00
Irevoire
8bc602a7dd
makes clippy happy 2022-10-27 11:35:23 +02:00
Irevoire
6c2ecec4d0
fix the return of the task cancelation and task deletion 2022-10-27 11:35:23 +02:00
Irevoire
6280bd51a9
actually fix the test and the swap_indexes name resolution 2022-10-27 11:35:23 +02:00
Irevoire
54d0aff4cf
ignore a strange test that works on my machine but not on the ci 2022-10-27 11:35:23 +02:00
Irevoire
b804cba4ca
try to debug the ci 2022-10-27 11:35:23 +02:00
Irevoire
3cf8aaa4d0
reformat 2022-10-27 11:35:23 +02:00
Kerollmops
0dd8e00929
Reapply #2601 2022-10-27 11:35:22 +02:00
Irevoire
a99ddf85f7
fix clippy once again 2022-10-27 11:35:22 +02:00
Irevoire
3979c9f02b
fix all the dump snasphots 2022-10-27 11:35:20 +02:00
Irevoire
8ec3681cf8
fix clippy part1 2022-10-27 11:35:20 +02:00
Kerollmops
861a07792e
Remove useless task module 2022-10-27 11:35:20 +02:00
Kerollmops
ee6597da60
Fix all the tests 2022-10-27 11:35:20 +02:00
Kerollmops
314b89ca30
Fix insta snapshots 2022-10-27 11:35:20 +02:00
Loïc Lecrenier
9b43528bbb
Update test after fixing bug in index swap 2022-10-27 11:35:18 +02:00
Loïc Lecrenier
e641d08846
Cargo fmt 2022-10-27 11:35:18 +02:00
Loïc Lecrenier
36c9f05998
Revert "Display more than one indexUid in a task view if necessary"
This reverts commit 1f2e253bb6.
2022-10-27 11:35:18 +02:00
Loïc Lecrenier
3b158bb966
Return invalid API key error in /swap-indexes 2022-10-27 11:35:18 +02:00
Loïc Lecrenier
08b5123380
Display more than one indexUid in a task view if necessary 2022-10-27 11:35:17 +02:00
Loïc Lecrenier
1f75caae88
Fix a few index swap bugs.
1. Details of the indexSwap task
2. Query tasks with type=indexUid
3. Synchronous error message for multiple index not found
2022-10-27 11:35:17 +02:00
Irevoire
a16604af80
fix all the tests 2022-10-27 11:35:17 +02:00
Irevoire
1d014a538e
comment out a test that makes the CI crash 2022-10-27 11:35:17 +02:00
Kerollmops
2de8a0711a
Cargo insta test/review 2022-10-27 11:35:16 +02:00
Kerollmops
2f577b6fcd
Patch the IndexScheduler in meilisearch-http to use the options struct 2022-10-27 11:35:16 +02:00
Tamo
eccbdb74cf
remove useless print
Co-authored-by: Clément Renault <clement@meilisearch.com>
2022-10-27 11:35:16 +02:00
Irevoire
033794d209
add tests for the task deletion and task cancelation 2022-10-27 11:35:16 +02:00
Irevoire
a85d5b4981
test the details of all tasks type 2022-10-27 11:35:16 +02:00
Kerollmops
4736e00253
Handle the CLI options related to snapshots 2022-10-27 11:35:15 +02:00
Kerollmops
942b7c338b
Compress the snapshot in a tarball 2022-10-27 11:35:15 +02:00
Kerollmops
4cafc63561
Reintroduce the versioning functions 2022-10-27 11:35:14 +02:00
Kerollmops
89e127e4f4
Declare the auth path in the index scheduler 2022-10-27 11:35:14 +02:00
Kerollmops
c063f154fb
Add the snapshots directory path to the IndexScheduler 2022-10-27 11:35:14 +02:00
Kerollmops
c641888a23
Patch the delete and cancel tasks routes 2022-10-27 11:35:13 +02:00
Irevoire
12669bf07c
rename received_documents_ids to matched_documents 2022-10-27 11:35:12 +02:00
Irevoire
0aca5e84b9
rename received_document_ids to matched_documents in the DocumentDeletion task type (reimplementation of #2826) 2022-10-27 11:35:12 +02:00
Irevoire
7e52f1effb
remove a lot of unecessary clone and ref 2022-10-27 11:35:11 +02:00
Irevoire
ecf4e43b3d
rename the dumpExport to dumpCreation 2022-10-27 11:35:10 +02:00