[SERVER-73746] Upgrade to v6.2 fails if a collection with recordPreImages exists Created: 08/Feb/23  Updated: 11/Oct/23  Resolved: 20/Feb/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 6.0.4
Fix Version/s: None

Type: Bug Priority: Critical - P2
Reporter: Dmitry Ryabtsev Assignee: Mindaugas Malinauskas
Resolution: Duplicate Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-73833 Automatically remove unsupported 'rec... Closed
Problem/Incident
is caused by SERVER-60919 Remove oplog based change stream pre-... Closed
Related
Assigned Teams:
Query Execution
Operating System: ALL
Steps To Reproduce:

m 6.0.4
mlaunch init --replicaset --nodes 1
mongo
> use test 
> db.coll1.insert({ _id: 1, created_at: new Date() });
> db.runCommand({ collMod: "coll1", recordPreImages: true });
> db.getSiblingDB("admin").shutdownServer()
 
# This will fail
rapid/mongodb-macos-x86_64-6.2.0/bin/mongod --replSet replset --dbpath data/replset/rs1/db --logpath data/replset/rs1/mongod.log --port 27017 --wiredTCacheSizeGB 1 

Sprint: QE 2023-02-20, QE 2023-03-06
Participants:
Case:

 Description   

This is an outcome of SERVER-60919 where recordPreImages was removed in favour of changeStreamPreAndPostImages.

MongoDB v6.2 will fail to start in an upgrade scenario if there is a collection with recordPreImages option.

This issue manifests if the upgrade source has FCV set to "6.0" or "6.1"



 Comments   
Comment by Kyle Suarez [ 10/Feb/23 ]

Based on discussion in Slack and elsewhere, Query Execution is working on SERVER-73833, which should solve this issue. (Unsure what to do about the Jira status, so I'll just leave it as-is for now.)

Comment by Dmitry Ryabtsev [ 08/Feb/23 ]

The solution is to run this before the upgrade:

db.runCommand({collMod: "coll1", changeStreamPreAndPostImages: { enabled: true} })

Generated at Thu Feb 08 06:25:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.