slave can't be queried during failover

XMLWordPrintableJSON

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

      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 Chodorow (Inactive)
              Reporter:
              Kristina Chodorow (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: