I just did the weekly update for our Discourse site and found that instead of taking the regular 1-2 minutes, this time about 20 minutes were needed. Also, progress update temporarily broke with timeout errors in the Chrome console at step $ SKIP_POST_DEPLOYMENT_MIGRATIONS=1 bundle exec rake multisite:migrate
(screenshot below)
I could see on the server that something was happening (load on postmaster and occasionally on ruby), and eventually progress updates recovered, but overall it seems like there might be an issue with the current migrations.
From the update logs, it seems that the migration responsible for the long runtime was DropTrgmIndexesOnUsers
. I have included the respective part of the log directly in this post below (full log is attached as a text file in case it is needed for further analysis).
********************************************************
*** Please be patient, next steps might take a while ***
********************************************************
...
$ LOAD_PLUGINS=0 bundle exec rake plugin:pull_compatible_all
discourse-bbcode is already at latest compatible version
discourse-data-explorer is already at latest compatible version
docker_manager is already at latest compatible version
$ SKIP_POST_DEPLOYMENT_MIGRATIONS=1 bundle exec rake multisite:migrate
Multisite migrator is running using 1 threads
Migrating default
== 20240912061702 DropUserSearchSimilarResultsSiteSetting: migrating ==========
-- execute("DELETE FROM site_settings WHERE name = 'user_search_similar_results';\n")
-> 0.0006s
== 20240912061702 DropUserSearchSimilarResultsSiteSetting: migrated (0.0015s) =
== 20240912061806 DropTrgmIndexesOnUsers: migrating ===========================
-- execute("DROP INDEX IF EXISTS index_users_on_username_lower_trgm;\nDROP INDEX IF EXISTS index_users_on_name_trgm;\n")
-> 1290.7163s
== 20240912061806 DropTrgmIndexesOnUsers: migrated (1290.7169s) ===============
== 20240912212253 IncreaseExternalAvatarUrlLimitTo2000: migrating =============
-- change_column(:single_sign_on_records, :external_avatar_url, :string, {:limit=>2000})
-> 0.0011s
== 20240912212253 IncreaseExternalAvatarUrlLimitTo2000: migrated (0.0017s) ====
Seeding default
*** Bundling assets. This will take a while ***
$ bundle exec rake themes:update assets:precompile
Building
Environment: production
building...
...
Full log: upgrade-log-2024-09-15.txt (124.7 KB)