Chapter 1 · Practice 3 of 3
Read the release notes and known issues before a major upgrade
Why it matters
Major upgrades change defaults and occasionally ship with known issues. The 9.0 release notes, for example, list:
- A per-operation memory limit (see the queries chapter) that can make heavy aggregations fail where they used to succeed.
- BSON validation on by default: invalid BSON is now rejected.
- A known issue where
listIndexesreports a simple collation explicitly at feature compatibility version 9.0, which can make Mongoose'ssyncIndexes()drop and rebuild unchanged indexes on every startup. The notes say to upgrade to Mongoose 9.10.4 or 8.24.5, or stop callingsyncIndexes()at startup. - A sharded cluster issue fixed in a later patch.
Upgrade in steps: one major version at a time, keep the old feature compatibility version (FCV) for a while so you can roll back, then raise FCV once the app is stable.
Example
// After upgrading binaries and verifying the app
db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 })
db.adminCommand({ setFeatureCompatibilityVersion: "9.0", confirm: true })