Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-73532

Image collection must be invalidated even when namespace is missing during initial sync

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 7.0.0-rc0
    • None
    • None
    • Replication
    • Fully Compatible
    • ALL
    • Repl 2023-03-06
    • 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.

      Attachments

        Activity

          People

            sean.zimmerman@mongodb.com Sean Zimmerman
            matthew.russotto@mongodb.com Matthew Russotto
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: