Commit Graph

266 Commits

Author SHA1 Message Date
Kerollmops
7093bae131
Update the dump test to check for the dumpUid dumpCreation task details 2022-11-23 14:48:39 +01:00
Kerollmops
84c782ce9a
Fix the insta tests 2022-11-22 18:53:17 +01:00
bors[bot]
dfaf845382
Merge #3080
3080: Rename `originalFilters` into `originalFilter` on the cancelation and deletion routes r=irevoire a=Kerollmops

This PR fixes https://github.com/meilisearch/meilisearch/issues/3079.

Co-authored-by: Clément Renault <clement@meilisearch.com>
2022-11-17 13:49:50 +00:00
Clément Renault
9fe32e1e3b
Rename matchedDocuments into providedIds 2022-11-17 13:48:23 +01:00
Clément Renault
388305fcb6
Rename originalFilters into originalFilters 2022-11-17 13:44:00 +01:00
bors[bot]
637ca7b9fa
Merge #3067
3067: Fix task details serialization r=Kerollmops a=ManyTheFish

# Pull Request

- document addition task details always contain the field `indexedDocuments`
  - value is set to `null` when the task is enqueued or processing
  - value is set to `0` when the task is canceled or failed
- the field `deletedDocuments` of the document deletion task details is set to `0` when the task is canceled or failed
- the field `deletedDocuments` of the document clearAll task details is set to `0` when the task is canceled or failed
- the field `deletedTasks` of the task deletion task details is set to `0` when the task is canceled or failed
- the field `canceledTasks` of the task cancelation task details is set to `0` when the task is canceled or failed

## Related issue
Fixes #3057
Fixes #3058


Co-authored-by: ManyTheFish <many@meilisearch.com>
2022-11-16 16:15:03 +00:00
ManyTheFish
25e39edc7e Fix tests 2022-11-16 16:45:20 +01:00
bors[bot]
8ddec58430
Merge #3061
3061: Name spawned threads r=irevoire a=dureuill

# Pull Request

## Related issue
None, this is to improve debuggability

## What does this PR do?
- This PR replaces the raw `thread::spawn(...)` calls by `thread::Builder::new().name(...).spawn(...).unwrap()` calls so that we can give meaningful names to threads. 
- This PR also setup the `rayon` thread pool to give a name to its threads.
- This improves debuggability, as the thread names are reported by debuggers:

<img width="411" alt="Capture d’écran 2022-11-16 à 10 26 27" src="https://user-images.githubusercontent.com/41078892/202141870-a88663aa-d2f8-494f-b4da-709fdbd072ba.png">

(screen showing vscode's debugger and its main/scheduler/indexing threads)

## 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>
2022-11-16 14:25:32 +00:00
ManyTheFish
07b28ea8cf Fix task details serialization 2022-11-16 13:47:08 +01:00
Louis Dureuil
93afeedcea
Spawn threads with names 2022-11-16 09:50:47 +01:00
Tamo
d08d97bf43
fix the error messages and add tests 2022-11-14 23:27:02 +01:00
Loïc Lecrenier
6126fc8d98 Rename original_query to original_filters everywhere 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
bors[bot]
3999f74f78
Merge #3022
3022: Store the `started_at` for a task that is canceled when processing r=irevoire a=Kerollmops

This PR changes the current behavior of the displayed tasks. When a processing task is canceled, the `started_at` date time is kept and displayed to the user. Otherwise, if the task was just enqueued, the `started_at` remains `null`. If a task is processing, the engine is ctrl-c, starts again, and the task becomes enqueued again, so if it is canceled, its `started_at` will be `null`.

You can read more [in this discussion](https://github.com/meilisearch/specifications/pull/195/files#r1009602335).

Co-authored-by: Kerollmops <clement@meilisearch.com>
2022-11-03 20:48:24 +00:00
Kerollmops
739b9f5505
Use the content of the ProcessingTasks in the tasks cancelation system 2022-11-03 11:09:59 +01:00
Loïc Lecrenier
5704a1895d Fix error code of the "duplicate index found" error 2022-11-02 09:34:50 +01:00
bors[bot]
dd1011ba76
Merge #2995
2995: merge the settings and do one indexation at the end r=irevoire a=irevoire



Co-authored-by: Irevoire <tamo@meilisearch.com>
2022-10-27 21:24:21 +00:00
bors[bot]
20258461a8
Merge #2981 #2996
2981: Move index swap error handling from meilisearch-http to index-scheduler r=irevoire a=loiclec

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.

## Related issue
https://github.com/meilisearch/meilisearch/issues/2973


2996: Get rids of the unecessary tasks when an index_uid is specified r=Kerollmops a=irevoire



Co-authored-by: Loïc Lecrenier <loic.lecrenier@me.com>
Co-authored-by: Tamo <tamo@meilisearch.com>
Co-authored-by: Irevoire <tamo@meilisearch.com>
2022-10-27 19:11:23 +00:00
Tamo
87cac158c4
Update index-scheduler/src/batch.rs 2022-10-27 18:08:21 +02:00
Tamo
c9f89d38e3
Merge branch 'main' into index-swap-error-handling 2022-10-27 18:06:45 +02:00
Irevoire
01687c87a2
Get rids of the unecessary tasks when an index_uid is specified 2022-10-27 18:00:04 +02:00
Irevoire
313f204f39
merge the settings and do one indexation at the end 2022-10-27 16:38:21 +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
8152ab5dfc Revert change in initialisation of TempDir for index scheduler tests 2022-10-27 16:26:17 +02:00
Loïc Lecrenier
2c31d7c50a Apply review suggestions 2022-10-27 16:24:08 +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
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
Irevoire
7307c4dacd
fix clippy 2022-10-27 11:35:22 +02:00
Irevoire
33996071ea
fix clippy from the CI 2022-10-27 11:35:21 +02:00
Kerollmops
7c908fadcf
Remove a useless clippy silence 2022-10-27 11:35:21 +02:00
Irevoire
07d39776f9
fix clippy _once again_ 2022-10-27 11:35:21 +02:00
Irevoire
8ec3681cf8
fix clippy part1 2022-10-27 11:35:20 +02:00
Kerollmops
2ba5e3b519
Clean up some code 2022-10-27 11:35:20 +02:00
Clément Renault
4f955e68b3
Apply suggestions from code review 2022-10-27 11:35:19 +02:00
Irevoire
6c98752922
move the commit before the insertion in the map 2022-10-27 11:35:19 +02:00
Irevoire
4e1b6b514e
update reviewer change 2022-10-27 11:35:19 +02:00
Irevoire
64e55b4db9
fix the index creation. When an index is being created we insert it in the index_map straight away to avoid someone else from trying to re-open it. The definitive fix should be made on milli's side 2022-10-27 11:35:18 +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
29bdcb880c
update the snapshot 2022-10-27 11:35:17 +02:00
Irevoire
a3fc0d3bd9
Fix the last regression 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
Kerollmops
71b50853dc
Introduce an options struct to create the IndexScheduler 2022-10-27 11:35:16 +02:00
Kerollmops
7074872a78
cargo insta accept 2022-10-27 11:35:15 +02:00
Kerollmops
035e8eeff5
Clean-up some TODOs 2022-10-27 11:35:15 +02:00
Kerollmops
e35fe33712
Fix some bugs with files 2022-10-27 11:35:15 +02:00