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

Enable useful write concern for no-op operations

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Replication, Write Ops
    • None

    Description

      Currently, if a write operation ends up being a no-op for some reason, no op is logged in the oplog. For example, there could be a race between two clients to update the same document to the same value. Whichever client wins the race will end up logging the op in the oplog, and will have an optime to use for waiting for write concern.
      It would be useful if the losing client could also wait for at least that same optime, even though it didn't do the write. Today, write concern would return immediately without waiting, because the optime in the Client is not updated if a write is a no-op.
      One proposal is to update the optime in the Client even on no-op writes. It could use the global lastOptime for this, since it doesn't know exactly which op it raced with.

      Attachments

        Activity

          People

            matt.dannenberg Matt Dannenberg
            milkie@mongodb.com Eric Milkie
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: