Skip to content

Improve Meilisearch Index upgrade workflow for Ulmo (reindex_studio) #36868

Open
@bradenmacdonald

Description

@bradenmacdonald

Currently the reindex_studio command is required before you can use any of Studio's search features. In addition, because the index format has changed between Teak and Ulmo, it will be necessary for operators to rebuild the search index during the upgrade to Ulmo.

  1. The reindex_studio command currently requires --experimental. Now that it's been used in two full releases (Sumac & Teak), the experimental flag should be removed.

  2. The reindex_studio command can take a long time to run (hours on large instances), so Tutor should not necessarily run a full synchronous index rebuild during its upgrade script. See this bug report for example.

    • the simplest approach is just to run reindex_studio --initial during the upgrade, (i.e. create a blank index with the new format - search results will be empty but the search code will work without error), and tell the user to run reindex_studio manually to fill in the content (which will be fast if they have little content, or could take ~ a day on very large instances).
    • a more sophisticated approach could be to check if the instance has < 50 courses + libraries and in that case run the full reindex_studio to completion, but if it has more, then just run reindex_studio --initial and tell the user to complete it on their own time.
    • an even better approach would be to just create the blank index (reindex_studio --initial) during init/upgrade and then kick off an async celery task to populate it incrementally in the background.
  3. The reindex_studio command has two modes: "normal" (create a new index, populate it, then cut over to it once it's fully populated. If interrupted, must start over again.) or "incremental" (start or continue populating the current index. If interrupted, can be resumed anytime). The "normal" mode should be removed and the "incremental" mode should be the only way of populating the index. This does mean that there could be a period of time during upgrades when Studio search results are incomplete, but it's worth it for simplicity. Also the incremental mode indexes newest content first, so should quickly fill in the content that users most care about.

  4. In coordination with Tutor, we should upgrade to the latest version of Meilisearch - especially if features like "Reduce indexing memory usage", "update documents with function", and contains filters are stable because those will be valuable features for us. (Not to mention High Availability, if/when it's implemented.)

    • Note that upgrades to Meilisearch 1.13+ are much easier than prior versions (prior versions required backup/restore, new versions just require an upgrade command like Mongo).

In the future we should also think about how to consolidate our search index management so that one command manages all the search indexes, rather than studio and LMS being separate. (Not to mention teams, forum, etc.). But this is blocked until we know if we're going to be supporting TypeSense or any other alternative to Meilisearch or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions