Skip to content

Commit f7871bd

Browse files
authored
Merge pull request #6486 from meilisearch/stabilize-dumpless-upgrade
Stabilize dumpless upgrade
2 parents 1546bdb + 1fd2fb8 commit f7871bd

20 files changed

Lines changed: 44 additions & 51 deletions

File tree

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Fixes #...
1414
- [ ] Automated tests have been added.
1515
- [ ] If some tests cannot be automated, manual rigorous tests should be applied.
1616
- [ ] ⚠️ If there is any change in the DB:
17-
- [ ] Test that any impacted DB still works as expected after using `--experimental-dumpless-upgrade` on a DB created with the last released Meilisearch
17+
- [ ] Test that any impacted DB still works as expected after using `--upgrade-db` on a DB created with the last released Meilisearch
1818
- [ ] Test that during the upgrade, **search is still available** (artificially make the upgrade longer if needed)
1919
- [ ] Set the `db change` label.
2020
- [ ] If necessary, the feature have been tested in the Cloud production environment (with [prototypes](./documentation/prototypes.md)) and the Cloud UI is ready.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ This project uses GitHub Merge Queues that helps us manage pull requests merging
238238
Before merging a PR, the maintainer should ensure the following requirements are met
239239
- Automated tests have been added.
240240
- If some tests cannot be automated, manual rigorous tests should be applied.
241-
- ⚠️ If there is an change in the DB: it's mandatory to manually test the `--experimental-dumpless-upgrade` on a DB of the previous Meilisearch minor version (e.g. v1.13 for the v1.14 release).
241+
- ⚠️ If there is an change in the DB: it's mandatory to manually test the `--upgrade-db` on a DB of the previous Meilisearch minor version (e.g. v1.13 for the v1.14 release).
242242
- If necessary, the feature have been tested in the Cloud production environment (with [prototypes](./documentation/prototypes.md)) and the Cloud UI is ready.
243243
- If necessary, the [documentation](https://github.com/meilisearch/documentation) related to the implemented feature in the PR is ready.
244244
- If necessary, the [integrations](https://github.com/meilisearch/integration-guides) related to the implemented feature in the PR are ready.

TESTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,9 @@ In most cases, the change binary instruction will be used to update a database.
198198

199199
To properly test the dumpless upgrade, one should typically:
200200

201-
1. Open the database without processing the update task: Use a `binary` instruction to switch to the desired version, passing `--experimental-dumpless-upgrade` and `--experimental-max-number-of-batched-tasks=0` as extra CLI arguments
201+
1. Open the database without processing the update task: Use a `binary` instruction to switch to the desired version, passing `--upgrade-db` and `--experimental-max-number-of-batched-tasks=0` as extra CLI arguments
202202
2. Check that the search, stats and task queue still work.
203-
3. Open the database and process the update task: Use a `binary` instruction to switch to the desired version, passing `--experimental-dumpless-upgrade` as the extra CLI argument. Use a `health` command to wait for the upgrade task to finish.
203+
3. Open the database and process the update task: Use a `binary` instruction to switch to the desired version, passing `--upgrade-db` as the extra CLI argument. Use a `health` command to wait for the upgrade task to finish.
204204
4. Check that the indexing, search, stats, and task queue still work.
205205

206206
```jsonc
@@ -223,7 +223,7 @@ To properly test the dumpless upgrade, one should typically:
223223
"source": "build", // build the binary from the sources in the current git repository
224224
"edition": "community",
225225
"extraCliArgs": [
226-
"--experimental-dumpless-upgrade", // allows to open with a newer MS
226+
"--upgrade-db", // allows to open with a newer MS
227227
"--experimental-max-number-of-batched-tasks=0" // prevent processing of the update task
228228
]
229229
}
@@ -238,7 +238,7 @@ To properly test the dumpless upgrade, one should typically:
238238
"source": "build", // build the binary from the sources in the current git repository
239239
"edition": "community",
240240
"extraCliArgs": [
241-
"--experimental-dumpless-upgrade" // allows to open with a newer MS
241+
"--upgrade-db" // allows to open with a newer MS
242242
// no `--experimental-max-number-of-batched-tasks=0`
243243
]
244244
}

crates/index-scheduler/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,6 @@ pub struct IndexSchedulerOptions {
160160
pub export_default_payload_size_bytes: Byte,
161161
/// The experimental features enabled for this instance.
162162
pub instance_features: InstanceTogglableFeatures,
163-
/// Whether the index scheduler is able to auto upgrade or not.
164-
pub auto_upgrade: bool,
165163
/// The maximal number of entries in the search query cache of an embedder.
166164
///
167165
/// 0 disables the cache.

crates/index-scheduler/src/scheduler/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ impl Scheduler {
127127
batched_tasks_size_limit,
128128
export_default_payload_size_bytes: _,
129129
instance_features: _,
130-
auto_upgrade: _,
131130
embedding_cache_cap,
132131
ip_policy,
133132
experimental_no_snapshot_compaction,

crates/index-scheduler/src/test_utils.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ impl IndexScheduler {
115115
batched_tasks_size_limit: u64::MAX,
116116
instance_features: Default::default(),
117117
export_default_payload_size_bytes: byte_unit::Byte::parse_str("20MiB", false).unwrap(),
118-
auto_upgrade: true, // Don't cost much and will ensure the happy path works
119118
embedding_cache_cap: 10,
120119
// NO DANGER: test code
121120
ip_policy: IpPolicy::danger_always_allow(),

crates/index-scheduler/src/upgrade/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub fn upgrade_index_scheduler(
6565

6666
if initial_version < (1, 12, 0) {
6767
bail!(
68-
"Database version {initial_major}.{initial_minor}.{initial_patch} is too old for the experimental dumpless upgrade feature. Please generate a dump using the v{initial_major}.{initial_minor}.{initial_patch} and import it in the v{target_major}.{target_minor}.{target_patch}",
68+
"Database version {initial_major}.{initial_minor}.{initial_patch} is too old to be upgraded via `--upgrade-db`. Please generate a dump using the v{initial_major}.{initial_minor}.{initial_patch} and import it in the v{target_major}.{target_minor}.{target_patch}",
6969
);
7070
}
7171

crates/meilisearch-types/src/versioning.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,14 @@ pub enum VersionFileError {
8181
MalformedVersionFile { context: String },
8282
#[error(
8383
"Your database version ({major}.{minor}.{patch}) is incompatible with your current engine version ({}).\n\
84-
To migrate data between Meilisearch versions, please follow our guide on https://www.meilisearch.com/docs/learn/update_and_migration/updating.",
84+
To migrate data between Meilisearch versions, please follow our guide on https://www.meilisearch.com/docs/learn/update_and_migration/updating.\n\
85+
Alternatively, you can set the `--upgrade-db` flag (or the `MEILI_UPGRADE_DB` environment variable) to upgrade the database on startup.",
8586
env!("CARGO_PKG_VERSION").to_string()
8687
)]
8788
VersionMismatch { major: u32, minor: u32, patch: u32 },
8889
#[error("Database version {major}.{minor}.{patch} is higher than the Meilisearch version {VERSION_MAJOR}.{VERSION_MINOR}.{VERSION_PATCH}. Downgrade is not supported")]
8990
DowngradeNotSupported { major: u32, minor: u32, patch: u32 },
90-
#[error("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 import it in the v{VERSION_MAJOR}.{VERSION_MINOR}.{VERSION_PATCH}")]
91+
#[error("Database version {major}.{minor}.{patch} is too old to be upgraded via `--upgrade-db`. Please generate a dump using the v{major}.{minor}.{patch} and import it in the v{VERSION_MAJOR}.{VERSION_MINOR}.{VERSION_PATCH}")]
9192
TooOldForAutomaticUpgrade { major: u32, minor: u32, patch: u32 },
9293
#[error("Error while modifying the database: {0}")]
9394
ErrorWhileModifyingTheDatabase(#[from] heed::Error),

crates/meilisearch/src/analytics/segment_analytics.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ struct Infos {
195195
experimental_drop_search_after: usize,
196196
experimental_nb_searches_per_core: usize,
197197
experimental_logs_mode: LogMode,
198-
experimental_dumpless_upgrade: bool,
198+
upgrade_db: bool,
199199
experimental_replication_parameters: bool,
200200
experimental_enable_logs_route: bool,
201201
experimental_dynamic_search_rules: bool,
@@ -261,7 +261,7 @@ impl Infos {
261261
experimental_drop_search_after,
262262
experimental_nb_searches_per_core,
263263
experimental_logs_mode,
264-
experimental_dumpless_upgrade,
264+
upgrade_db,
265265
experimental_replication_parameters,
266266
experimental_enable_logs_route,
267267
experimental_reduce_indexing_memory_usage,
@@ -344,7 +344,7 @@ impl Infos {
344344
experimental_drop_search_after: experimental_drop_search_after.into(),
345345
experimental_nb_searches_per_core: experimental_nb_searches_per_core.into(),
346346
experimental_logs_mode,
347-
experimental_dumpless_upgrade,
347+
upgrade_db,
348348
experimental_replication_parameters,
349349
experimental_enable_logs_route: experimental_enable_logs_route | logs_route,
350350
experimental_dynamic_search_rules: dynamic_search_rules,

crates/meilisearch/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ pub fn setup_meilisearch(
307307
index_growth_amount: byte_unit::Byte::from_str("10GiB").unwrap().as_u64() as usize,
308308
index_count: DEFAULT_INDEX_COUNT,
309309
instance_features: opt.to_instance_features(),
310-
auto_upgrade: opt.experimental_dumpless_upgrade,
311310
embedding_cache_cap: opt.experimental_embedding_cache_entries,
312311
experimental_no_snapshot_compaction: opt.experimental_no_snapshot_compaction,
313312
ip_policy,
@@ -454,7 +453,7 @@ fn check_version(
454453
let (db_major, db_minor, db_patch) = get_version(&opt.db_path)?;
455454

456455
if db_major != bin_major || db_minor != bin_minor || db_patch != bin_patch {
457-
if opt.experimental_dumpless_upgrade {
456+
if opt.upgrade_db {
458457
update_version_file_for_dumpless_upgrade(
459458
opt,
460459
index_scheduler_opt,

0 commit comments

Comments
 (0)