fix the details in all cases

This commit is contained in:
Tamo 2025-01-22 15:58:39 +01:00
parent 27103263f7
commit a256021f3e
No known key found for this signature in database
GPG Key ID: 20CD8020AFA88D69
16 changed files with 45 additions and 19 deletions

View File

@ -8,7 +8,7 @@ snapshot_kind: text
----------------------------------------------------------------------
### All Tasks:
0 {uid: 0, batch_uid: 1, status: succeeded, details: { primary_key: Some("mouse") }, kind: IndexCreation { index_uid: "catto", primary_key: Some("mouse") }}
1 {uid: 1, batch_uid: 0, status: succeeded, kind: UpgradeDatabase { from: (1, 12, 0) }}
1 {uid: 1, batch_uid: 0, status: succeeded, details: { from: v1.12.0 }, kind: UpgradeDatabase { from: (1, 12, 0) }}
2 {uid: 2, batch_uid: 2, status: succeeded, details: { primary_key: Some("bone") }, kind: IndexCreation { index_uid: "doggo", primary_key: Some("bone") }}
3 {uid: 3, batch_uid: 3, status: failed, error: ResponseError { code: 200, message: "Index `doggo` already exists.", error_code: "index_already_exists", error_type: "invalid_request", error_link: "https://docs.meilisearch.com/errors#index_already_exists" }, details: { primary_key: Some("bone") }, kind: IndexCreation { index_uid: "doggo", primary_key: Some("bone") }}
4 {uid: 4, batch_uid: 4, status: succeeded, details: { primary_key: Some("leaves") }, kind: IndexCreation { index_uid: "girafo", primary_key: Some("leaves") }}
@ -58,7 +58,7 @@ girafo: { number_of_documents: 0, field_distribution: {} }
[timestamp] [4,]
----------------------------------------------------------------------
### All Batches:
0 {uid: 0, details: {}, stats: {"totalNbTasks":1,"status":{"succeeded":1},"types":{"upgradeDatabase":1},"indexUids":{}}, }
0 {uid: 0, details: {"upgradeFrom":"v1.12.0"}, stats: {"totalNbTasks":1,"status":{"succeeded":1},"types":{"upgradeDatabase":1},"indexUids":{}}, }
1 {uid: 1, details: {"primaryKey":"mouse"}, stats: {"totalNbTasks":1,"status":{"succeeded":1},"types":{"indexCreation":1},"indexUids":{"catto":1}}, }
2 {uid: 2, details: {"primaryKey":"bone"}, stats: {"totalNbTasks":1,"status":{"succeeded":1},"types":{"indexCreation":1},"indexUids":{"doggo":1}}, }
3 {uid: 3, details: {"primaryKey":"bone"}, stats: {"totalNbTasks":1,"status":{"failed":1},"types":{"indexCreation":1},"indexUids":{"doggo":1}}, }

View File

@ -8,7 +8,7 @@ snapshot_kind: text
----------------------------------------------------------------------
### All Tasks:
0 {uid: 0, status: enqueued, details: { primary_key: Some("mouse") }, kind: IndexCreation { index_uid: "catto", primary_key: Some("mouse") }}
1 {uid: 1, status: enqueued, kind: UpgradeDatabase { from: (1, 12, 0) }}
1 {uid: 1, status: enqueued, details: { from: v1.12.0 }, kind: UpgradeDatabase { from: (1, 12, 0) }}
----------------------------------------------------------------------
### Status:
enqueued [0,1,]

View File

@ -8,7 +8,7 @@ snapshot_kind: text
----------------------------------------------------------------------
### All Tasks:
0 {uid: 0, status: enqueued, details: { primary_key: Some("mouse") }, kind: IndexCreation { index_uid: "catto", primary_key: Some("mouse") }}
1 {uid: 1, batch_uid: 0, status: failed, error: ResponseError { code: 200, message: "Planned failure for tests.", error_code: "internal", error_type: "internal", error_link: "https://docs.meilisearch.com/errors#internal" }, kind: UpgradeDatabase { from: (1, 12, 0) }}
1 {uid: 1, batch_uid: 0, status: failed, error: ResponseError { code: 200, message: "Planned failure for tests.", error_code: "internal", error_type: "internal", error_link: "https://docs.meilisearch.com/errors#internal" }, details: { from: v1.12.0 }, kind: UpgradeDatabase { from: (1, 12, 0) }}
----------------------------------------------------------------------
### Status:
enqueued [0,]
@ -38,7 +38,7 @@ catto [0,]
[timestamp] [1,]
----------------------------------------------------------------------
### All Batches:
0 {uid: 0, details: {}, stats: {"totalNbTasks":1,"status":{"failed":1},"types":{"upgradeDatabase":1},"indexUids":{}}, }
0 {uid: 0, details: {"upgradeFrom":"v1.12.0"}, stats: {"totalNbTasks":1,"status":{"failed":1},"types":{"upgradeDatabase":1},"indexUids":{}}, }
----------------------------------------------------------------------
### Batch to tasks mapping:
0 [1,]

View File

@ -8,7 +8,7 @@ snapshot_kind: text
----------------------------------------------------------------------
### All Tasks:
0 {uid: 0, status: enqueued, details: { primary_key: Some("mouse") }, kind: IndexCreation { index_uid: "catto", primary_key: Some("mouse") }}
1 {uid: 1, batch_uid: 0, status: failed, error: ResponseError { code: 200, message: "Planned failure for tests.", error_code: "internal", error_type: "internal", error_link: "https://docs.meilisearch.com/errors#internal" }, kind: UpgradeDatabase { from: (1, 12, 0) }}
1 {uid: 1, batch_uid: 0, status: failed, error: ResponseError { code: 200, message: "Planned failure for tests.", error_code: "internal", error_type: "internal", error_link: "https://docs.meilisearch.com/errors#internal" }, details: { from: v1.12.0 }, kind: UpgradeDatabase { from: (1, 12, 0) }}
2 {uid: 2, status: enqueued, details: { primary_key: Some("bone") }, kind: IndexCreation { index_uid: "doggo", primary_key: Some("bone") }}
----------------------------------------------------------------------
### Status:
@ -41,7 +41,7 @@ doggo [2,]
[timestamp] [1,]
----------------------------------------------------------------------
### All Batches:
0 {uid: 0, details: {}, stats: {"totalNbTasks":1,"status":{"failed":1},"types":{"upgradeDatabase":1},"indexUids":{}}, }
0 {uid: 0, details: {"upgradeFrom":"v1.12.0"}, stats: {"totalNbTasks":1,"status":{"failed":1},"types":{"upgradeDatabase":1},"indexUids":{}}, }
----------------------------------------------------------------------
### Batch to tasks mapping:
0 [1,]

View File

@ -8,7 +8,7 @@ snapshot_kind: text
----------------------------------------------------------------------
### All Tasks:
0 {uid: 0, status: enqueued, details: { primary_key: Some("mouse") }, kind: IndexCreation { index_uid: "catto", primary_key: Some("mouse") }}
1 {uid: 1, batch_uid: 0, status: succeeded, kind: UpgradeDatabase { from: (1, 12, 0) }}
1 {uid: 1, batch_uid: 0, status: succeeded, details: { from: v1.12.0 }, kind: UpgradeDatabase { from: (1, 12, 0) }}
2 {uid: 2, status: enqueued, details: { primary_key: Some("bone") }, kind: IndexCreation { index_uid: "doggo", primary_key: Some("bone") }}
3 {uid: 3, status: enqueued, details: { primary_key: Some("bone") }, kind: IndexCreation { index_uid: "doggo", primary_key: Some("bone") }}
----------------------------------------------------------------------
@ -44,7 +44,7 @@ doggo [2,3,]
[timestamp] [1,]
----------------------------------------------------------------------
### All Batches:
0 {uid: 0, details: {}, stats: {"totalNbTasks":1,"status":{"succeeded":1},"types":{"upgradeDatabase":1},"indexUids":{}}, }
0 {uid: 0, details: {"upgradeFrom":"v1.12.0"}, stats: {"totalNbTasks":1,"status":{"succeeded":1},"types":{"upgradeDatabase":1},"indexUids":{}}, }
----------------------------------------------------------------------
### Batch to tasks mapping:
0 [1,]

View File

@ -2,7 +2,7 @@ use std::path::Path;
use anyhow::bail;
use meilisearch_types::heed;
use meilisearch_types::tasks::{KindWithContent, Status, Task};
use meilisearch_types::tasks::{Details, KindWithContent, Status, Task};
use meilisearch_types::versioning::{VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH};
use time::OffsetDateTime;
use tracing::info;
@ -66,7 +66,7 @@ pub fn upgrade_task_queue(
finished_at: None,
error: None,
canceled_by: None,
details: None,
details: Some(Details::UpgradeDatabase { from }),
status: Status::Enqueued,
kind: KindWithContent::UpgradeDatabase { from },
},

View File

@ -269,7 +269,9 @@ impl KindWithContent {
}),
KindWithContent::DumpCreation { .. } => Some(Details::Dump { dump_uid: None }),
KindWithContent::SnapshotCreation => None,
KindWithContent::UpgradeDatabase { .. } => None,
KindWithContent::UpgradeDatabase { from } => {
Some(Details::UpgradeDatabase { from: (from.0, from.1, from.2) })
}
}
}
@ -328,7 +330,9 @@ impl KindWithContent {
}),
KindWithContent::DumpCreation { .. } => Some(Details::Dump { dump_uid: None }),
KindWithContent::SnapshotCreation => None,
KindWithContent::UpgradeDatabase { .. } => None,
KindWithContent::UpgradeDatabase { from } => {
Some(Details::UpgradeDatabase { from: *from })
}
}
}
}
@ -369,7 +373,9 @@ impl From<&KindWithContent> for Option<Details> {
}),
KindWithContent::DumpCreation { .. } => Some(Details::Dump { dump_uid: None }),
KindWithContent::SnapshotCreation => None,
KindWithContent::UpgradeDatabase { .. } => None,
KindWithContent::UpgradeDatabase { from } => {
Some(Details::UpgradeDatabase { from: *from })
}
}
}
}
@ -623,7 +629,7 @@ pub enum Details {
swaps: Vec<IndexSwap>,
},
UpgradeDatabase {
from: (usize, usize, usize),
from: (u32, u32, u32),
},
}

Binary file not shown.

View File

@ -7,7 +7,9 @@ snapshot_kind: text
{
"uid": 20,
"progress": null,
"details": {},
"details": {
"upgradeFrom": "v1.12.0"
},
"stats": {
"totalNbTasks": 1,
"status": {

View File

@ -7,7 +7,9 @@ snapshot_kind: text
{
"uid": 20,
"progress": null,
"details": {},
"details": {
"upgradeFrom": "v1.12.0"
},
"stats": {
"totalNbTasks": 1,
"status": {

View File

@ -7,7 +7,9 @@ snapshot_kind: text
{
"uid": 20,
"progress": null,
"details": {},
"details": {
"upgradeFrom": "v1.12.0"
},
"stats": {
"totalNbTasks": 1,
"status": {

View File

@ -11,6 +11,9 @@ snapshot_kind: text
"status": "succeeded",
"type": "upgradeDatabase",
"canceledBy": null,
"details": {
"upgradeFrom": "v1.12.0"
},
"error": null,
"duration": "[duration]",
"enqueuedAt": "[date]",

View File

@ -11,6 +11,9 @@ snapshot_kind: text
"status": "succeeded",
"type": "upgradeDatabase",
"canceledBy": null,
"details": {
"upgradeFrom": "v1.12.0"
},
"error": null,
"duration": "[duration]",
"enqueuedAt": "[date]",

View File

@ -11,6 +11,9 @@ snapshot_kind: text
"status": "succeeded",
"type": "upgradeDatabase",
"canceledBy": null,
"details": {
"upgradeFrom": "v1.12.0"
},
"error": null,
"duration": "[duration]",
"enqueuedAt": "[date]",

View File

@ -7,7 +7,9 @@ snapshot_kind: text
{
"uid": 20,
"progress": null,
"details": {},
"details": {
"upgradeFrom": "v1.12.0"
},
"stats": {
"totalNbTasks": 1,
"status": {

View File

@ -11,6 +11,9 @@ snapshot_kind: text
"status": "succeeded",
"type": "upgradeDatabase",
"canceledBy": null,
"details": {
"upgradeFrom": "v1.12.0"
},
"error": null,
"duration": "[duration]",
"enqueuedAt": "[date]",