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

getLastError returns replicatedTo which is different than value of "w"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.3.2
    • Fix Version/s: 2.4.0-rc1
    • Component/s: Replication
    • Labels:
      None
    • Operating System:
      ALL

      Description

      When getlasterror is called with w:3 the number 3 represents the total number of nodes that have the write when getlasterror returns null err.

      However, implementation of SERVER-4073 returns just replicatedTo members, omitting the primary which also has the write.

      Aside from it being difficult to later track if application logs have the full writeResult but no information about which node was primary (and also has the write) it also feels unintuitive.

      I think it would be less confusing to end user if w:3 returns a structure with writtenTo: [node list] that on success is greater-than or equal the "w" value and on failure or timeout writtenTo.length will be shorter than "w".

      Here's an example:

      {
      	"updatedExisting" : true,
      	"n" : 1,
      	"lastOp" : {
      		"t" : 1358883684000,
      		"i" : 1
      	},
      	"connectionId" : 1,
      	"wtimeout" : true,
      	"waited" : 2000,
      	"replicatedTo" : [ ],
      	"err" : "timeout",
      	"ok" : 1
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kristina Kristina Chodorow
              Reporter:
              asya Asya Kamsky
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: