API/behavior changes

Describe routes and behavior changes

When passing the CLI flag --experimental-dumpless-upgrade to Meilisearch, or the environment variable MEILI_EXPERIMENTAL_DUMPLESS_UPGRADE, then starting Meilisearch v1.13 on a database whose VERSION file indicates 1.12.x, for any x (typically, created with Meilisearch v1.12) does not cause the usual version mismatch error.

Instead, a new task is immediately created on the task queue with the type UpgradeDatabase , and the VERSION file is immediately updated to the precise version of the running Meilisearch instance (e.g. 1.13.0).

That task is immediately processed alone in its own batch (no autobatching) and cannot be canceled.

While the task is processing, the following actions are still possible, as is usual with other kinds of tasks:

If the upgrade completes successfully, then the UpgradeDatabase task will be marked as status successful, and Meilisearch will resume batching the enqueued tasks.

Not passing --experimental-dumpless-upgrade or MEILI_EXPERIMENTAL_DUMPLESS_UPGRADE to Meilisearch retains the current behavior of throwing a version mismatch error on startup. Passing the flag or environment variable has no effect if the VERSION file already contains 1.13.x, for any x.

Passing the flag or environment variable when the VERSION file contains a version that is not v1.12 or v1.13 will cause Meilisearch to exit in error.

The table below summarizes the behavior of the flag and environment variable depending on the value in VERSION

VERSION in the DB --experimental-dumpless-upgrade or MEILI_EXPERIMENTAL_DUMPLESS_UPGRADE present Behavior when starting Meilisearch v1.13 on the DB
for all x, 1.12.x absent Meilisearch exits on startup with version mismatch error
for all x, 1.12.x present Spawn upgrade task
for all x, 1.13.x absent Meilisearch starts normally
for all x, 1.13.x present Meilisearch starts normally
Anything else absent Meilisearch exits on startup with version mismatch error
Anything else present Meilisearch exits on startup with unsupported upgrade path error

While the UpgradeDatabase task is processing, the associated batch contains a progress field informing the user of the progress of the upgrade.

Although progress contents is not stable and should not be relied upon programmatically, the progress object typically contains one step level that indicates how many indexes were handled and how many indexes still need upgrading.

As soon as the UpgradeDatabase task was spawned, launching Meilisearch with an older version will cause it to exit with a version mismatch error, since the VERSION file was immediately updated.

If the Meilisearch instance is terminated while the UpgradeDatabase is processing, the next restart of Meilisearch v1.13 on that database will resume processing the UpgradeDatabase task. The processing will restart at the last index that was being upgraded, meaning it will not restart from scratch.

If the UpgradeDatabase task fails for any reason, then the following will occur: