Upgrade to Mongo 7
kdmccormick opened this issue · 3 comments
(Originally mentioned here: https://discuss.openedx.org/t/tutor-cs-comment-service-mongo-and-ruby-upgrade/12472)
edx-platform and cs_comments_service are now both being tested with Mongo 7 (openedx/edx-platform#34213), so we can now upgrade Tutor to use Mongo 7. We should apply the change to Tutor Nightly, the sooner the better. It would be ideal to do it before the Redwood cut (late April), although the true deadline is the Redwood release (June 9).
The line that needs to be changed: https://github.com/overhangio/tutor/blob/nightly/tutor/templates/config/defaults.yml#L23
https://discuss.openedx.org/t/tutor-edx-platform-mongo-7-upgrade/12512 also confirms that it is safe to upgrade Mongo as both cs_comments_service and edx-platform are running on Mongo 7.
We would also (probably) need to update the upgrade scripts, in tutor/commands/upgrade, to make sure that existing MongoDb 4 databases are successfully migrated to v7.
Since there have been major releases since 4.4, the upgrade would need to go through them before running on Mongo 7. Therefore, during upgrade command, mongo would need to follow 4.4 --> 5.0 --> 6.0 --> 7.0 to work correctly.
- https://www.mongodb.com/community/forums/t/mongodb-upgrade-from-4-2-and-4-4-to-6-0/205176
- https://www.mongodb.com/community/forums/t/restore-backup-from-mongo-4-2-to-7/242906
There are some other changes across various versions:
- db.adminCommand needs confirm: true when upgrading and setting compatibility to v7 (https://www.mongodb.com/docs/manual/reference/command/setFeatureCompatibilityVersion/#confirm)
- Starting with mongo 6.1, the
--nojournal
commandline argument is no longer needed as journal is enabled by default (https://www.mongodb.com/docs/manual/reference/configuration-file-settings-command-line-options-mapping/#changelog) - mongo binary is not available in docker images starting with v6. mongosh should be used in its place (docker-library/mongo#558, docker-library/mongo#553 (comment))