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

slave can't be queried during failover

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.6.2, 1.7.0
    • Affects Version/s: None
    • Component/s: Replication
    • None
    • ALL

      If you start 3 servers and then set slaveOk on one of the slaves, then kill the primary, there are a couple seconds where querying the slave doesn't work:

      > b1.getMongo().setSlaveOk()
      > b1.bar.find() // querying the slave works
      > b1.bar.find()
      > b1.bar.find()
      > b1.bar.find() // kill the master
      error:

      { "$err" : "not master", "code" : 10107 }

      > b1.bar.find()
      error:

      { "$err" : "not master", "code" : 10107 }

      > b1.bar.find()
      error:

      { "$err" : "not master", "code" : 10107 }

      > b1.bar.find()
      error:

      { "$err" : "not master", "code" : 10107 }

      > b1.bar.find()
      error:

      { "$err" : "not master", "code" : 10107 }

      > b1.bar.find()
      error:

      { "$err" : "not master", "code" : 10107 }

      > b1.bar.find()
      error:

      { "$err" : "not master", "code" : 10107 }

      > b1.bar.find()
      error:

      { "$err" : "not master", "code" : 10107 }

      > b1.bar.find()
      error:

      { "$err" : "not master", "code" : 10107 }

      > b1.bar.find()
      error:

      { "$err" : "not master", "code" : 10107 }

      > b1.bar.find() // querying the slave works again
      > b1.bar.find()
      > b1.bar.find()
      > b1.bar.find()

      I'm having a hard time writing an automatic test that reproduces this, but I'll commit it when I get it working.

            Assignee:
            kristina Kristina Chodorow (Inactive)
            Reporter:
            kristina Kristina Chodorow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: