[SERVER-73532] Image collection must be invalidated even when namespace is missing during initial sync Created: 01/Feb/23  Updated: 29/Oct/23  Resolved: 01/Mar/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Matthew Russotto Assignee: Sean Zimmerman
Resolution: Fixed Votes: 0
Labels: repl-shortlist
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-76159 Image collection entry is not invalid... Open
Assigned Teams:
Replication
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2023-03-06
Participants:
Linked BF Score: 6

 Description   

The config.image_collection holds the last preImage or postImage returned by a findAndModify call, keyed by session id. During initial sync, any preImages or postImages created during oplog application should be invalidated by code in oplog application (oplog.cpp). When the collection has been deleted at the time of application, this invalidation does not happen. There are two places this needs to be fixed.

1) In oplog.cpp, we test for a failure of a collectionUUID to resolve near the top of applyOperation_inlock. If this happens and this operation is a type which returns a preImage or postImage, it should invalidate (and do nothing else).

2) in oplog_applier_utils, in applyOplogEntryOrGroupedInsertsCommon, we obtain a lock on the collection using AutoGetCollection. This will throw a NamespaceNotFound error if the collectionUUID does not resolve. To avoid scattering invalidation code throughout the namespace, we should probably instead ensure this will go ahead and call applyOperation_inlock even if the UUID does not resolve, when we know the data is not consistent. In that case we can take the lock using the namespace in the oplog entry.



 Comments   
Comment by Githook User [ 01/Mar/23 ]

Author:

{'name': 'seanzimm', 'email': 'sean.zimmerman@mongodb.com', 'username': 'seanzimm'}

Message: SERVER-73532: Invalidate image collection entry when namespace is missing during initial sync
Branch: master
https://github.com/mongodb/mongo/commit/0a07e17eaba4ba38db3084ab77e14333a72c73c8

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