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

scan_checked_replset.js attempts to incorrectly scan on truncated collection name

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • None
    • None
    • None
    • None
    • ALL

    Description

      Currently, scan_checked_replset.js parses namespaces from documents by splitting the namespace on a period ".".

      let [dbName, collName] = doc.namespace.split('.', 2);
      

      This is problematic for collections that contain periods in the collection name, e.g:

      admin.system.users
      config.system.sessions
      

      This leads to the script attempting to scan on partial namespaces:

      {
      	"msg" : "Scanning range",
      	"range" : {
      		"_id" : {
      			"db" : "admin",
      			"collection" : "system",
      			"minKey" : { "$minKey" : 1 },
      			"maxKey" : { "$maxKey" : 1 }
      		}
      	}
      }
      {
      	"msg" : "Scanning range",
      	"range" : {
      		"_id" : {
      			"db" : "config",
      			"collection" : "system",
      			"minKey" : { "$minKey" : 1 },
      			"maxKey" : { "$maxKey" : 1 }
      		}
      	}
      }
      

      We can fix this by ensuring that the full collection name is not split against by slicing on the first occurrence of a "."

      let i = doc.namespace.indexOf(".")
      let [dbName, collName] = [doc.namespace.slice(0,i), doc.namespace.slice(i+1)];
      

      Attachments

        Issue Links

          Activity

            People

              eric.sedor@mongodb.com Eric Sedor
              edwin.zhou@mongodb.com Edwin Zhou
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: