add a large test importing a data.ms from the v1.12.0

This commit is contained in:
Tamo 2025-01-20 14:37:31 +01:00 committed by Louis Dureuil
parent 102681e384
commit 0cc25c7e4c
No known key found for this signature in database
43 changed files with 4675 additions and 11 deletions

View file

@ -903,7 +903,7 @@ fn create_and_list_index() {
index_scheduler.index("kefir").unwrap();
let list = index_scheduler.get_paginated_indexes_stats(&AuthFilter::default(), 0, 20).unwrap();
snapshot!(json_string!(list, { "[1][0][1].created_at" => "[date]", "[1][0][1].updated_at" => "[date]" }), @r#"
snapshot!(json_string!(list, { "[1][0][1].created_at" => "[date]", "[1][0][1].updated_at" => "[date]", "[1][0][1].used_database_size" => "[bytes]", "[1][0][1].database_size" => "[bytes]" }), @r#"
[
1,
[
@ -911,8 +911,8 @@ fn create_and_list_index() {
"kefir",
{
"number_of_documents": 0,
"database_size": 24576,
"used_database_size": 8192,
"database_size": "[bytes]",
"used_database_size": "[bytes]",
"primary_key": null,
"field_distribution": {},
"created_at": "[date]",

View file

@ -20,7 +20,7 @@ pub fn upgrade_task_queue(tasks_path: &Path, from: (u32, u32, u32)) -> anyhow::R
[(v1_12_to_current as fn(&Path) -> anyhow::Result<()>, "Upgrading from v1.12 to v1.13")];
let start = match from {
(1, 12, patch) if patch < current_patch => 0,
(1, 12, _) => 0,
(major, minor, patch) => {
if major > current_major
|| (major == current_major && minor > current_minor)
@ -29,10 +29,7 @@ pub fn upgrade_task_queue(tasks_path: &Path, from: (u32, u32, u32)) -> anyhow::R
bail!(
"Database version {major}.{minor}.{patch} is higher than the binary version {current_major}.{current_minor}.{current_patch}. Downgrade is not supported",
);
} else if major < current_major
|| (major == current_major && minor < current_minor)
|| (major == current_major && minor == current_minor && patch < current_patch)
{
} else if major < 1 || (major == current_major && minor < 12) {
bail!(
"Database version {major}.{minor}.{patch} is too old for the experimental dumpless upgrade feature. Please generate a dump using the v{major}.{minor}.{patch} and imports it in the v{current_major}.{current_minor}.{current_patch}",
);