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
    • Labels:
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      MOTOR-19 Done 0.4
      PYTHON-644 Done 2.8, 3.0
      PERL-493 Done 1.0.2
      JAVA-1955 Done 3.2.0
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion MOTOR-19 Done 0.4 PYTHON-644 Done 2.8, 3.0 PERL-493 Done 1.0.2 JAVA-1955 Done 3.2.0

      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: