Commit Graph

172 Commits

Author SHA1 Message Date
Tamo
52aa34d984
remove an unused error handling file 2022-12-20 16:32:51 +01:00
Louis Dureuil
869d331680
Clippy fixes after updating Rust to v1.66 2022-12-19 14:17:12 +01:00
curquiza
026cf223b3 Update version for the next release (v1.0.0) in Cargo.toml files 2022-12-08 12:20:17 +00:00
Tamo
1c3a326199
stop snapshotting the version of meilisearch in the dump
It might change and we don't want to update this test everytime we make a new release.
2022-12-07 13:26:02 +01:00
Kerollmops
c1337f9e08
Update dump snap to new version 2022-12-07 11:48:29 +01:00
curquiza
5db7c4057c Update version for the next release (v0.30.1) in Cargo.toml files 2022-12-06 20:05:46 +01:00
bors[bot]
2867d2e91a
Merge #3190
3190: Fix the dump date-import of the dumpv4 r=irevoire a=irevoire

# Pull Request
After merging https://github.com/meilisearch/meilisearch/pull/3012 I realized that the tests on the date of the dump-v4 were still ignored, thus, I fixed them and then noticed #3012 wasn't working properly.

## Related issue
Fixes https://github.com/meilisearch/meilisearch/issues/2987 a second time


`@funilrys` since you wrote most of the code you might be interested, but don't feel obligated to review this code. 
Someone from the team will double-check it works 😁 

Co-authored-by: Tamo <tamo@meilisearch.com>
2022-12-06 10:47:00 +00:00
Tamo
bef81065f9 return the same time in case we didn't found a created or updated at 2022-12-06 11:03:23 +01:00
Tamo
180511795b
Update dump/src/reader/v4/mod.rs fix typo
Co-authored-by: Louis Dureuil <louis@meilisearch.com>
2022-12-06 10:53:43 +01:00
bors[bot]
9b23885e85
Merge #3188
3188: re-enable the dump test on the dates r=irevoire a=irevoire

I just noticed that we have the real date in the dump-v1 contrarily to the dump-v2/3/4/5, thus we can ensure it doesn't change unexpectedly 👍 

Co-authored-by: Tamo <tamo@meilisearch.com>
2022-12-05 18:10:22 +00:00
Tamo
9c89e3dadc
uncomment more test for the dump v4 2022-12-05 18:15:29 +01:00
Tamo
b0cf431614
Fix the dump date-import of the dumpv4 2022-12-05 18:08:35 +01:00
Tamo
688911ed34
re-enable the dump test on the dates 2022-12-05 17:05:37 +01:00
bors[bot]
776af129bf
Merge #3012
3012: Extract the dates out of the dumpv4. r=irevoire a=funilrys

Hi there, 

please review this PR that tries to fix #2987. I'm still learning Rust and I found that #2987 is an excellent way for me to read and learn what others do with Rust. So please excuse my semantics ...

Stay safe and healthy.

---

# Pull Request

This patch possibly fixes #2987.

This patch introduces a way to fill the IndexMetadata.created_at and IndexMetadata.updated_at keys from the tasks events. This is done by reading the creation date of the first event (created_at) and the creation date of the last event (updated_at).


## Related issue
Fixes #2987

## What does this PR do?
- Extract the dates out of the dumpv4.

## 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: funilrys <contact@funilrys.com>
2022-12-05 15:57:07 +00:00
funilrys
8b6eba4f0b
Apply fmt. 2022-12-03 17:47:02 +01:00
funilrys
e510ace179
fixup! Re-open tasks queue. 2022-12-03 17:41:33 +01:00
funilrys
f056fc118f
Re-open tasks queue.
Indeed, before this patch, I was (probably) breaking every usage
of the tasks BufReader. This patch solves the issue by reopening
the the tasks file every time its needed.
2022-12-03 17:29:41 +01:00
Louis Dureuil
1260c32d18
Add reader mod test 2022-12-01 14:03:15 +01:00
Louis Dureuil
e03c216952
Add compat_v1_to_v2 test 2022-12-01 14:03:15 +01:00
Louis Dureuil
c7749127fa
Use reader v1 and compat to v2 2022-12-01 14:03:15 +01:00
Louis Dureuil
c8841344e2
v1: RankingRule::from_str 2022-12-01 14:03:15 +01:00
Louis Dureuil
b8de369e33
Add v1 reader 2022-12-01 14:03:15 +01:00
Louis Dureuil
d44652209d
impl Display for v2::settings::Criterion 2022-12-01 11:15:57 +01:00
Louis Dureuil
5d22c7bcce
Make some dump types Clone 2022-12-01 11:15:57 +01:00
Tamo
41eb986f65
Fix the dump tests 2022-11-28 16:39:22 +01:00
Clémentine Urquizar - curqui
457a473b72
Bring back release-v0.30.0 into release-v0.30.0-temp (final: into main) (#3145)
* Fix error code of the "duplicate index found" error

* Use the content of the ProcessingTasks in the tasks cancelation system

* Change the missing_filters error code into missing_task_filters

* WIP Introduce the invalid_task_uid error code

* 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

* Add canceledBy task filter

* Update tests following task API changes

* Rename original_query to original_filters everywhere

* Update more insta-snap tests

* Make clippy happy

They're a happy clip now.

* Make rustfmt happy

>:-(

* Fix Index name parsing error message to fit the specification

* Bump milli version to 0.35.1

* Fix the new error messages

* fix the error messages and add tests

* rename the error codes for the sake of consistency

* refactor the way we send the cli informations + add the analytics for the config file and ssl usage

* Apply suggestions from code review

Co-authored-by: Clément Renault <clement@meilisearch.com>

* add a comment over the new infos structure

* reformat, sorry @kero

* Store analytics for the documents deletions

* Add analytics on all the settings

* Spawn threads with names

* Spawn rayon threads with names

* update the distinct attributes to the spec update

* update the analytics on the search route

* implements the analytics on the health and version routes

* Fix task details serialization

* Add the question mark to the task deletion query filter

* Add the question mark to the task cancelation query filter

* Fix tests

* add analytics on the task route

* Add all the missing fields of the new task query type
* Create a new analytics for the task deletion
* Create a new analytics for the task creation

* batch the tasks seen events

* Update the finite pagination analytics

* add the analytics of the swap-indexes route

* Stop removing the DB when failing to read it

* Rename originalFilters into originalFilters

* Rename matchedDocuments into providedIds

* Add `workflow_dispatch` to flaky.yml

* Bump grenad to 0.4.4

* Bump milli to version v0.37.0

* Don't multiply total memory returned by sysinfo anymore

sysinfo now returns bytes rather than KB

* Add a dispatch to the publish binaries workflow

* Fix publish release CI

* Don't use gold but the default linker

* Always display details for the indexDeletion task

* Fix the insta tests

* refactorize the whole test suite
1. Make a call to assert_internally_consistent automatically when snapshoting the scheduler. There is no point in snapshoting something broken and expect the dumb humans to notice.
2. Replace every possible call to assert_internally_consistent by a snapshot of the scheduler. It takes as many lines and ensure we never change something without noticing in any tests ever.
3. Name every snapshots: it's easier to debug when something goes wrong and easier to review in general.
4. Stop skipping breakpoints, it's too easy to miss something. Now you must explicitely show which path is the scheduler supposed to use.
5. Add a timeout on the channel.recv, it eases the process of writing tests, now when something file you get a failure instead of a deadlock.

* rebase on release-v0.30

* makes clippy happy

* update the snapshots after a rebase

* try to remove the flakyness of the failing test

* Add more analytics on the ranking rules positions

* Update the dump test to check for the dumpUid dumpCreation task details

* send the ranking rules as a string because amplitude is too dumb to process an array as a single value

* Display a null dumpUid until we computed the dump itself on disk

* Update tests

* Check if the master key is missing before returning an error

Co-authored-by: Loïc Lecrenier <loic.lecrenier@me.com>
Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Co-authored-by: Kerollmops <clement@meilisearch.com>
Co-authored-by: ManyTheFish <many@meilisearch.com>
Co-authored-by: Tamo <tamo@meilisearch.com>
Co-authored-by: Louis Dureuil <louis@meilisearch.com>
2022-11-28 16:27:41 +01:00
Tamo
7b8641a7af
fix the dump tests
The issue was linked to the fact that the debug implementation of the PhantomData wasn't the same between rust stable and rust nightly.
This was causing an issue while snapshsotting the settings and this commit fix it by representing the settings as json which already ignores the PhantomData
2022-11-23 16:59:20 +01:00
funilrys
e81b349658
Fix linting issue. 2022-11-14 18:51:34 +01:00
funilrys
0a102d601c
Update Task.created_at
Indeed, before this patch we weren't considering the
TaskContent::SetingsUpdate while trying to find the creation date.
2022-11-13 10:14:20 +01:00
funilrys
8a14f6f545
Add Task.processed_at. 2022-11-13 10:13:10 +01:00
funilrys
079357ee1f
Fix linting issues. 2022-11-12 20:57:27 +01:00
funilrys
06e7db7a1f
fixup! Extract the dates out of the dumpv4. 2022-11-12 18:28:23 +01:00
funilrys
953b2ec438
fixup! Extract the dates out of the dumpv4. 2022-11-02 17:49:37 +01:00
funilrys
ab3056cc66
Extract the dates out of the dumpv4.
This patch possibly fixes #2987.

This patch introduces a way to fill the IndexMetadata.created_at
and IndexMetadata.updated_at keys from the tasks events.
This is done by reading the creation date of the first event
(created_at) and the creation date of the last event (updated_at).
2022-10-31 18:58:14 +01:00
Irevoire
510afda590
remove unused import 2022-10-30 20:05:20 +01:00
Irevoire
fea9fdcd7e
fix the dump reader process when no instance-uid was specified 2022-10-30 20:00:27 +01: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
225405bb0d
ignore the dump tests 2022-10-27 11:35:22 +02:00
Irevoire
6aa816d96a
use meili-snap in the dump 2022-10-27 11:35:22 +02:00
Irevoire
866a3676eb
reupload the test fix for the dump 2022-10-27 11:35:22 +02:00
Kerollmops
fa84eae0f1
Insta review and fix insta snapshots 2022-10-27 11:35:21 +02:00
Irevoire
3979c9f02b
fix all the dump snasphots 2022-10-27 11:35:20 +02:00
Kerollmops
314b89ca30
Fix insta snapshots 2022-10-27 11:35:20 +02:00
Irevoire
0ba6253eed
fix the sort 2022-10-27 11:35:19 +02:00
Irevoire
e8cd571820
try to convert the OsStr to a rust string to fix the sort 2022-10-27 11:35:19 +02:00
Loïc Lecrenier
e641d08846
Cargo fmt 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
a16604af80
fix all the tests 2022-10-27 11:35:17 +02:00
Kerollmops
2de8a0711a
Cargo insta test/review 2022-10-27 11:35:16 +02:00
Kerollmops
7074872a78
cargo insta accept 2022-10-27 11:35:15 +02:00
Kerollmops
e0548e42e7
Rename the Snapshot task into SnapshotCreation 2022-10-27 11:35:14 +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
Irevoire
eb4bdde432
fix clippy 2022-10-27 11:35:09 +02:00
Irevoire
e9055f5572
fix clippy 2022-10-27 11:35:08 +02:00
Irevoire
de7d4200d8
fix the snapshot tests of the dump after renaming a bunch of kinds 2022-10-27 11:35:08 +02:00
Irevoire
8d1408c65e
fix the import of the dumpv4&v5 when there is no instance-uid + rename the Kind+KindWithContent+Details variant for the DocumentImport and the Setting 2022-10-27 11:35:05 +02:00
Clément Renault
32cfac0cfd
Sort the TOML dependencies 2022-10-27 11:35:05 +02:00
Clément Renault
80b2e70ee7
Introduce a rustfmt file 2022-10-27 11:35:05 +02:00
Loïc Lecrenier
17cd2a4aa0
Implement POST /indexes-swap 2022-10-27 11:34:15 +02:00
Irevoire
66c3b93ef1
fix all the snapshot tests in the dump 2022-10-27 11:34:15 +02:00
Tamo
6730e190db
fix the dumps tests since we added informations in the DumpTask 2022-10-27 11:34:13 +02:00
Kerollmops
290945e258
Update the canceledBy and finishedAt fields 2022-10-27 11:34:11 +02:00
Kerollmops
725158b454
Introduce the core algorithm of task cancelation 2022-10-27 11:34:11 +02:00
Kerollmops
591527a99d
Prefer using TaskDeletion in the dumps 2022-10-27 11:34:11 +02:00
Kerollmops
1ca9a67c49
Introduce the task cancelation task type 2022-10-27 11:34:11 +02:00
Tamo
6bd6321226
dump the content of the dump tasks instead of recreating at import time with wrong API keys 2022-10-27 11:34:08 +02:00
Tamo
83f3c5ec57
flush the dump-writer only once everything has been inserted 2022-10-27 11:34:08 +02:00
Tamo
78ce29f461
apply most style comments of the review 2022-10-27 11:34:08 +02:00
Tamo
dd70daaae3
Update dump/src/error.rs
Co-authored-by: Clément Renault <clement@meilisearch.com>
2022-10-27 11:34:08 +02:00
Tamo
d0e91555d1
rebase on index-scheduler 2022-10-27 11:34:08 +02:00
Tamo
a9eeb070b8
fix all the errors code and settings issues when importing a dump v2 2022-10-27 11:34:07 +02:00
Tamo
3872a1b8d1
fix all the error codes 2022-10-27 11:34:07 +02:00
Tamo
955d3339f0
remove the dbg 2022-10-27 11:34:06 +02:00
Tamo
208c785697
add a bufwriter on the documents 2022-10-27 11:34:06 +02:00
Tamo
d976e680c5
first mostly working version 2022-10-27 11:34:06 +02:00
Tamo
c051166bcc
update the API a little bit 2022-10-27 11:34:05 +02:00
Tamo
72a906ae75
fix the tests 2022-10-27 11:34:05 +02:00
Tamo
b7f9c94f4a
write the dump export 2022-10-27 11:34:05 +02:00
Tamo
7034803712
move the API key in meilisearch_types 2022-10-27 11:34:02 +02:00
Tamo
c192146fbe
remove an unused file 2022-10-27 11:34:02 +02:00
Tamo
2f1eb78b1d
refactor the Task a little bit 2022-10-27 11:34:02 +02:00
Tamo
510ce9fc51
start moving a lot of task types to meilisearch_types 2022-10-27 11:34:01 +02:00
Tamo
fa4c1de019
store md5 instead of the whole snapshots 2022-10-27 11:34:01 +02:00
Tamo
0af00f6b32
fix all the import and comment most of the dump v6 2022-10-27 11:34:01 +02:00
Tamo
667c282e19
get rids of the index crate + the document_types crate 2022-10-27 11:34:00 +02:00
Tamo
f026ac3115
remove unused files 2022-10-27 11:33:58 +02:00
Tamo
f176382b34
fix the tests 2022-10-27 11:33:57 +02:00
Tamo
4bd9e4d723
write a bunch of tests that goes through the whole compat layers 2022-10-27 11:33:57 +02:00
Tamo
c6f4fb5f7d
remove the warnings 2022-10-27 11:33:57 +02:00
Tamo
2ae0806773
rewrite the update file API 2022-10-27 11:33:57 +02:00
Tamo
7579a363ab
finish the dump reader API, the dump Writer API now needs to be updated 2022-10-27 11:33:57 +02:00
Tamo
0284764b5e
start dumping the update files to a known format 2022-10-27 11:33:56 +02:00
Tamo
9117fde712
fix the compat between v3 and v4 2022-10-27 11:33:56 +02:00
Tamo
f622ef9836
remove the ununsed snapshot files 2022-10-27 11:33:56 +02:00
Tamo
dc0f307d61
remove all warnings 2022-10-27 11:33:56 +02:00
Tamo
06fadb3004
write the compat layer from v2 to v3 2022-10-27 11:33:55 +02:00
Tamo
6107540ad4
remove old compat files 2022-10-27 11:33:55 +02:00
Tamo
7e18f92635
write the dump v2 import 2022-10-27 11:33:55 +02:00