Commit Graph

1142 Commits

Author SHA1 Message Date
Louis Dureuil
1a1ede96de
Spawn rayon threads with names 2022-11-16 10:28:25 +01:00
Louis Dureuil
93afeedcea
Spawn threads with names 2022-11-16 09:50:47 +01:00
Tamo
4953b62712
reformat, sorry @kero 2022-11-15 17:57:27 +01:00
Tamo
9473cccc27
add a comment over the new infos structure 2022-11-15 17:56:07 +01:00
Tamo
9327db3e91
Apply suggestions from code review
Co-authored-by: Clément Renault <clement@meilisearch.com>
2022-11-15 17:53:23 +01:00
Tamo
0fced6f270
refactor the way we send the cli informations + add the analytics for the config file and ssl usage 2022-11-15 16:32:31 +01:00
bors[bot]
a8991ccb64
Merge #3036
3036: Bump milli to v0.35.1 r=irevoire a=Kerollmops

This PR bumps milli to v0.35.1 which brings some fixes. You can see [the changelog of milli on the release page](https://github.com/meilisearch/milli/releases/tag/v0.35.1).

Fixes #2905
Fixes #3004
Fixes #3000
Fixes #3021
Fixes #2945

Co-authored-by: Clément Renault <clement@meilisearch.com>
Co-authored-by: Kerollmops <clement@meilisearch.com>
2022-11-10 14:25:54 +00:00
Kerollmops
761bd3aca4
Fix the new error messages 2022-11-10 12:04:25 +01:00
bors[bot]
379522ace3
Merge #3023
3023: Update error codes related to tasks cancelation + add canceledBy filter r=Kerollmops a=Kerollmops

<details>This PR changes the error codes [to follow the specification](https://github.com/meilisearch/specifications/pull/195).

 - [x] The `missing_filters` error code is renamed `missing_task_filters` to be more accurate and follow the `invalid_task_*` convention.
 - [x] The error code `invalid_task_uids_filter` is added.
 - [x] The error code `invalid_task_canceled_by_filter` is added.
 - [x] The error code `invalid_task_date_filter` is added.
      -  The error message is the same as for expires_at in the API Key  EXCEPT that it does not explicitly mention that a date must be given in the future.
</details>

Edit by `@loiclec` :
I have added a few more changes into this PR. The related issues are:

- Fixes https://github.com/meilisearch/meilisearch/issues/3029
- Implements https://github.com/meilisearch/meilisearch/issues/3026
- Fixes https://github.com/meilisearch/meilisearch/issues/2940
- Fixes https://github.com/meilisearch/meilisearch/issues/2939

Additionally:
- Fixes a bug where global tasks were returned by `GET /tasks` queries even if the user did not have the `index.*` API key action.
- Rename `originalQuery` to `originalFilters`
- Display `error: null` and `canceledBy: null` in the task views
- Allow using the star operator in the task filters in the `DELETE /tasks` and `POST /tasks/cancel` routes
- Make sure that the index scheduler keeps making progress even when a grave error occurs.


Co-authored-by: Kerollmops <clement@meilisearch.com>
Co-authored-by: Clément Renault <clement@meilisearch.com>
Co-authored-by: Loïc Lecrenier <loic.lecrenier@me.com>
2022-11-10 10:51:41 +00:00
ManyTheFish
8bb260bf3e Fix Index name parsing error message to fit the specification 2022-11-08 16:35:58 +01:00
Loïc Lecrenier
52b38bee9d Make rustfmt happy
>:-(
2022-11-08 15:45:53 +01:00
Loïc Lecrenier
f5454dfa60 Make clippy happy
They're a happy clip now.
2022-11-08 15:31:08 +01:00
Loïc Lecrenier
1e464e87fc Update more insta-snap tests 2022-11-08 13:39:52 +01:00
Loïc Lecrenier
6126fc8d98 Rename original_query to original_filters everywhere 2022-11-08 13:18:18 +01:00
Loïc Lecrenier
2fdd814e57 Update tests following task API changes 2022-11-08 13:18:18 +01:00
Loïc Lecrenier
20fa103992 Add canceledBy task filter 2022-11-08 13:18:18 +01:00
Loïc Lecrenier
d5638d2c27 Use more precise error codes/message for the task routes
+ Allow star operator in delete/cancel tasks
+ rename originalQuery to originalFilters
+ Display error/canceled_by in task view even when they are = null
+ Rename task filter fields by using their plural forms
+ Prepare an error code for canceledBy filter
+ Only return global tasks if the API key action `index.*` is there
2022-11-08 13:18:17 +01:00
Clément Renault
932414bf72 WIP Introduce the invalid_task_uid error code 2022-11-08 13:17:56 +01:00
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