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

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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.4.0-rc1
    • Affects Version/s: 2.3.2
    • Component/s: Replication
    • None
    • ALL

      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
      }
      

            Assignee:
            kristina Kristina Chodorow (Inactive)
            Reporter:
            asya.kamsky@mongodb.com Asya Kamsky
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: