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

Get last error with w:x needs to take into account priority of members of the replica set?

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.5.6
    • Component/s: Replication
    • Labels:
      None

      Looking through docs:

      db.runCommand(

      { getlasterror : 1 , w : 2 }

      )

      needs to take priority of slaves in the replica set

      if you have 3 in a set and one of them is slave only i.e. can never take over as primary, then you can still lose data if that is machine that the replication is confirmed to have gone to:

      Steps:

      A - current primary
      B - backup primary (currently slave)
      C - slave only

      write to A. B is unreachable at the moment.
      Call getLastError (w:2). Data is at A and C, but not B. So returns true

      A goes down. B takes over as primary (its now reachable). Resync happens between B and C. C drops data that B doesn't have.

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            nosh nosh petigara
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: