1 / 1
Sep 2024

Hi All,

I upgraded from mongo:5 to mongo:6 and I did the last step which was:

db.adminCommand({ setFeatureCompatibilityVersion: "6.0"})

Everthing was fine till for some reason I don’t know the FeatureCompatibilityVersion was downgraded to “5.0” and I’m trying to find why.

The real problem here is the downgrading is not done successfully, it’s stuck and I can’t complete it or cancel it.
in other words, watch the following commands and responses:

rs0 [direct: primary] test> db.version() 6.0.17 rs0 [direct: primary] test> db.adminCommand({ getParameter: 1, featureCompatibilityVersion: 1 }) { featureCompatibilityVersion: { version: '5.0', targetVersion: '5.0', previousVersion: '6.0' }, ok: 1, '$clusterTime': { clusterTime: Timestamp({ t: 1725733102, i: 1 }), signature: { hash: Binary.createFromBase64('AAAAAAAAAAAAAAAAAAAAAAAAAAA=', 0), keyId: Long('0') } }, operationTime: Timestamp({ t: 1725733102, i: 1 }) } rs0 [direct: primary] test> db.adminCommand({ setFeatureCompatibilityVersion: "5.0" }); MongoServerError[CannotDowngrade]: Cannot downgrade the cluster as collection shops.ShopReviews has 'changeStreamPreAndPostImages' enabled rs0 [direct: primary] test> db.runCommand({ collMod: "shops.ShopReviews", changeStreamPreAndPostImages: { enabled: false } }) MongoServerError[InvalidOptions]: BSON field 'changeStreamPreAndPostImages' is an unknown field. rs0 [direct: primary] test> db.adminCommand({ setFeatureCompatibilityVersion: "6.0" }); MongoServerError[Location5147403]: cannot set featureCompatibilityVersion to '6.0' while featureCompatibilityVersion is 'downgrading from 6.0 to 5.0' rs0 [direct: primary] test> db.adminCommand({ setFeatureCompatibilityVersion: "6.0", confirm: true }); MongoServerError[Location40415]: BSON field 'setFeatureCompatibilityVersion.confirm' is an unknown field. rs0 [direct: primary] test>

I tried restarting the engine but no luck.

How can I get out of this deadlock without dropping the collection?

Thanks in advance.