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

Add "bypassEmptyTsReplacement" param to insert, update, findAndModify, and bulkWrite

    • Query Execution
    • Fully Compatible
    • v8.0, v7.0, v6.0, v5.0
    • 200

      Issue description doc: https://docs.google.com/document/d/1jXByNwGhMMGBBnOJcO_jmUShFO71oO9cT1EBinbF9oQ/edit

      MongoDB's insert command has a quirk where, if the record being inserted has any 0-valued timestamps ("Timestamp(0,0)"), these timestamps are replaced with the current time (as described in MongoDB's docs here).

      MongoDB's update, findAndModify, and bulkWrite commands also have a similar quirk where, in some cases, 0-valued timestamps will be replaced with the current time.

      At present, there is no easy way to insert/update/upsert documents using the aforementioned commands without triggering this "replace Timestamp(0,0) with current time" behavior.

      This poses a problem for mongosync, because mongosync needs an efficient way to copy a collection from a source cluster to a destination cluster as-is using the aforementioned commands (and it also needs an efficient way to keep the destination up-to-date by periodically replaying updates from the source's oplog as-is).

      This issue also affects mongorestore and mongoimport.

      The goal of this task is to see if we can provide a way for external tools to insert/update/upsert documents without triggering the "replace Timestamp(0,0) with current time" behavior.

            Assignee:
            andrew.paroski@mongodb.com Drew Paroski
            Reporter:
            andrew.paroski@mongodb.com Drew Paroski
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: