Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-131

Drivers should only send {w:1} if and when the user has specified.

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Component/s: None

      According the the documentation, a driver should not send any arguments along with GLE (or to the new write commands) unless the user has specified some.

      The server interprets a no-arg GLE (or empty document write concern for the new write commands) as an indication to use the server's defaults. If a driver sends

      {w:1}

      as the "default", then it is always overriding the server's getLastErrorDefaults.

      In practice, this is likely not a big deal as a high majority of users don't even know that getLastErrorDefaults exist and, of the ones that do, most wouldn't be changing it. As such, this is a low priority.

      Examples:

      1. mongodb://localhost
        • GLE: { getLastError: 1}
        • Write Commands: don't include a writeConcern in the command.
      2. mongodb://localhost?w=0
        • GLE: don't send one
        • Write Commands: { writeConcern : { w: 0 } }. In addition, the driver is responsible for not blocking while waiting on the result.
      3. mongodb://localhost?w=1
        • GLE: { getLastError: 1, w: 1 }
        • Write Commands: { writeConcern: { w: 1 } }
      4. mongodb://localhost?journal=true
        • GLE: { getLastError : 1, j: true }
        • Write Commands: { writeConcern : { j : true } }

            Assignee:
            barrie Barrie Segal
            Reporter:
            craig.wilson@mongodb.com Craig Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: