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

Insert from update replaces {_id:Timestamp()} with current date+inc

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.5
    • Affects Version/s: None
    • Component/s: Replication, Write Ops
    • Labels:
    • Major Change
    • ALL
      1. Startup a replica set.
      2. launch shell to primary
      3. Executed db.foo.insert({_id:Timestamp()})
      4. Secondary dies.

      When inserting a document into a collection using a Timestamp as the identifier, if the time and ordinal are both 0, the secondary fails on replication and throws an fassert failure causing mongod to die. In addition, any attempt to restart the secondary will fail as that same op will attempt to replicate and cause the same exception again. This is a change in behavior from the previous 2.4 release line.

      I tried this with other combinations of timestamps, both in value and in location in the document and it's always when the timestamp is _id with 0's for both of its components.

      2014-01-13T14:03:24.987-0600 [repl writer worker 1] ERROR: writer worker caught
      exception:  :: caused by :: 16836 The _id field cannot be changed from {_id: Timestamp 0|0} to {_id: Timestamp 1389643404000|1}. on: { ts: Timestamp 1389643404000|1, h: -2969864546816060428, v: 2, op: "i", ns: "test.foo", o: { _id: Timestamp 0|0 } }
      2014-01-13T14:03:24.987-0600 [repl writer worker 1] Fatal Assertion 16360
      2014-01-13T14:03:24.987-0600 [repl writer worker 1]
      ***aborting after fassert() failure

            scotthernandez Scott Hernandez (Inactive)
            craig.wilson@mongodb.com Craig Wilson
            0 Vote for this issue
            5 Start watching this issue