Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-2158

Clarify applyOps Oplog behavior

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • 01112017-cleanup
    • None
    • manual
    • None

    Description

      Please explicitly mention that the applyOps operation doesn't add the given Oplog Records to the local Oplog.

      Having two nodes with in different Clusters and executing this:

      • aabb:PRIMARY> db.collection.save( {b:1}

        )

        • Oplog Record

           { "ts" : Timestamp(1382985958, 1), "h" : NumberLong("-1797539322905744578"), "v" : 2, "op" : "i", "ns" : "test.collection", "o" : { "_id" : ObjectId("526eb0e682a153834ab771e8"), "b" : 1 } }

      • Executing the oplog record on second node
        • Command

          bbbb:PRIMARY> use local
          switched to db local
          bbbb:PRIMARY> db.runCommand({"applyOps":[{ "ts" : Timestamp(1382985958, 1), "h" : NumberLong("-1797539322905744578"), "v" : 2, "op" : "i", "ns" : "test.collection", "o" : { "_id" : ObjectId("526eb0e682a153834ab771e8"), "b" : 1 } }]})
          { "applied" : 1, "results" : [ true ], "ok" : 1 }

      Does not add the oplog record to node twos Oplog, which I would expect to happen if this node is replicated as well.

      bbbb:PRIMARY> db.oplog.rs.find()
      { "ts" : Timestamp(1382984560, 1), "h" : NumberLong(0), "v" : 2, "op" : "n", "ns" : "", "o" : { "msg" : "initiating set" } }

      Attachments

        Activity

          People

            sam.kleinman Sam Kleinman (Inactive)
            pheinze Philipp Heinze
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              10 years, 16 weeks, 2 days ago