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

applyOps createIndexes command with non-existent UUID reports success

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Replication
    • ALL

      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.

            Assignee:
            backlog-server-repl [DO NOT USE] Backlog - Replication Team
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: