How to Set the MongoDB "featureCompatibilityVersion" Flag Before and During the SPI 10.17.0 Upgrade
3 min
note this procedure is only applicable for upgrades to spi 10 17 0 preventing the issue to prevent the issue from occurring, follow the 10 17 0 upgrade instructions as usual however, before deploying the new 10 17 0 version in the admin console, complete steps 2 through 5 below issue overview upgrading from any spi version earlier than 10 17 0 to 10 17 0 can cause mongodb pods to become stuck in init 1/3 or init 2/3 this issue occurs because the "featurecompatibilityversion" document flag in mongodb is not set correctly to verify if this issue affects your upgrade, run the following command to check the mongodb logs kubectl logs \<mongo primary> c bootstrap if you encounter an error similar to the following {"error" "upgrade problem found an invalid featurecompatibilityversion document (error location4926900 invalid featurecompatibilityversion document in admin system version { id \\"featurecompatibilityversion\\", version \\"4 4\\" }"} you have encountered the featurecompatibilityversion issue solution steps to resolve this problem, follow these steps rollback to the previous version deploy back to the previous version you are upgrading from via the admin console you might need to make a minor change in the configuration page (such as updating the logging level field) to enable the console to save and deploy the previous version adjust feature compatibility version once the previous spi version is deployed, the mongodb pod should return to a running state (restart it if it doesn't) exec into the mongodb primary replica set member switch to the swimlane database and run the following command to set the feature compatibility version db admincommand({ setfeaturecompatibilityversion '5 0' }) verify the feature compatibility version confirm that the featurecompatibilityversion is set to 5 0 by running db admincommand({ getparameter 1, featurecompatibilityversion 1 }) upgrade to spi 10 17 0 deploy spi 10 17 0 via the admin console you might need to make a small change in the configuration page (such as updating the logging level field) to enable the console to save and deploy the new version verify pod status after the deployment, all mongodb pods should start normally by following these steps, you can ensure a smooth upgrade to spi 10 17 0