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

dropIndexes() CollectionUUIDMismatch has incorrect 'expectedCollection' on timeseries view

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • ALL
    • Hide

      // In a replica set env

       

      const randomCollName = "randColl"
      assert.commandWorked(db.runCommand({create: randomCollName}));
      const randomCollUUID = db.getCollectionInfos({name: randomCollName})[0].info.uuid;
       
      const tsViewName = "tsViewNs";
      db.createCollection(tsViewName, {timeseries: {timeField: "t", metaField: "m"}});
       
      // Fails here with 'expectedCollection': 'system.buckets.tsViewNs'
      assert.commandWorked(db.runCommand(
          {dropIndexes: tsViewName, index: {"myField": 1}, collectionUUID: randomCollUUID}))
      

       

      Show
      // In a replica set env   const randomCollName = "randColl" assert .commandWorked(db.runCommand({create: randomCollName})); const randomCollUUID = db.getCollectionInfos({name: randomCollName})[0].info.uuid;   const tsViewName = "tsViewNs" ; db.createCollection(tsViewName, {timeseries: {timeField: "t" , metaField: "m" }});   // Fails here with 'expectedCollection' : 'system.buckets.tsViewNs' assert .commandWorked(db.runCommand(     {dropIndexes: tsViewName, index: { "myField" : 1}, collectionUUID: randomCollUUID}))  

      Commands issued on a view with a 'collectionUUID' are always expected to fail with CollectionUUIDMismatch. The CollectionUUIDMismatch should return 'expectedCollection': <viewName>.

      However, when run on a timeseries view, dropIndexes() return the underlying 'system.buckets' collection as the 'expectedCollection'

      [js_test:myrepro] uncaught exception: Error: command failed: {
      [js_test:myrepro] 	"ok" : 0,
      [js_test:myrepro] 	"errmsg" : "Collection UUID does not match that specified",
      [js_test:myrepro] 	"code" : 361,
      [js_test:myrepro] 	"codeName" : "CollectionUUIDMismatch",
      [js_test:myrepro] 	"db" : "test",
      [js_test:myrepro] 	"collectionUUID" : UUID("9e4648ba-fd04-4c35-a0dc-c40f27a8ad10"),
      [js_test:myrepro] 	"expectedCollection" : "system.buckets.tsViewNs",
      [js_test:myrepro] 	"actualCollection" : "randColl"
      [js_test:myrepro] } with original command request: {
      [js_test:myrepro] 	"dropIndexes" : "tsViewNs",
      [js_test:myrepro] 	"index" : {
      [js_test:myrepro] 		"myField" : 1
      [js_test:myrepro] 	},
      [js_test:myrepro] 	"collectionUUID" : UUID("9e4648ba-fd04-4c35-a0dc-c40f27a8ad10"),
      [js_test:myrepro] 	"lsid" : {
      [js_test:myrepro] 		"id" : UUID("7f1e25a5-321b-43bc-abe7-e8b3e7f26aad")
      [js_test:myrepro] 	}
      [js_test:myrepro] } 

            Assignee:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            haley.connelly@mongodb.com Haley Connelly
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: