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

MongoDB servers processes should only setLastError when wire writes or write commands fail.

    • Minor Change

      MongoDB servers only promise that getLastError returns meaningful information about errors in wire-protocol writes or write commands. For finds, getmores and all other commands, the error component of getLastError has unspecified meaning. By setting the lastError information higher in the call stack, when we know they won't be swallowed, we can make lastError more sensible, and also break the triangle dependency between the lasterror, network and foundation libraries.

      This changes the behavior from prior versions of MongoDB, in which servers occasionally set the last error information in non-write commands and failed find operations. However, the servers were not consistent about the conditions in which they would set the information, as drivers were not expected to consult it.

            Assignee:
            schwerin@mongodb.com Andy Schwerin
            Reporter:
            schwerin@mongodb.com Andy Schwerin
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: