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

applyOps createIndexes command with non-existent UUID reports success

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Won't Fix
    • None
    • None
    • None
    • ALL

    Description

      applyOps with a createIndexes command reports success when given a non-existent UUID but it is actually a no-op.

      > db.adminCommand({applyOps: [{op:"c", ui: UUID("a0aff12b-0a98-429b-9f2a-892b57fcdbd5"), ns: "test.$cmd", o: {createIndexes: "test", key: {a:1}, name: "a_1"}}]});
      {
      	"applied" : 1,
      	"results" : [
      		true
      	],
      	"ok" : 1,
      	"operationTime" : Timestamp(1535665569, 1),
      	"$clusterTime" : {
      		"clusterTime" : Timestamp(1535665569, 1),
      		"signature" : {
      			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
      			"keyId" : NumberLong(0)
      		}
      	}
      }
      > db.test.getIndexes()
      [ ]
      > db.getCollectionInfos()
      [ ]
      

      I think it would make more sense for applyOps to report an error in this case.

      The same behavior exists on 3.6 and 4.0.

      Attachments

        Issue Links

          Activity

            People

              backlog-server-repl Backlog - Replication Team
              shane.harvey@mongodb.com Shane Harvey
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: