How to Set the MongoDB "featureCompatibilityVersion" Flag Before and During the SPI 10.17.0 Upgrade
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:
If you encounter an error similar to the following:
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:
- Verify the Feature Compatibility Version:
- Confirm that the featureCompatibilityVersion is set to 5.0 by running:
- 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.