Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-298

Ruby driver should re-check resumed replica set secondaries

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.0
    • Component/s: None
    • Labels:
    • Environment:
      Gentoo Linux amd64
      MongoDB 1.8.2
      Mongoid 2.0.2

      Description

      I sent this issue to MongoID github repository. Durran told me it is an issue in the Ruby driver, so I post it here.

      Mongoid config:

      development:
      hosts:

      • - foo
      • 27017
      • - bar
      • 27017
        read_secondary: true

      foo is the primary, bar is secondary, other nodes are hidden.

      When I start the application, writes go to foo, reads go to bar. This is fine.
      Then I stop mongodb on bar.
      Writes go to foo and reads go to foo. Fine.
      Then I start mongodn on bar.
      Writes should go to foo and reads should go to bar again.
      However reads still go to foo. No matter how long I wait after restarting bar.

      I have to restart the whole rails application to make mongoid to query bar again for reads.
      Mongoid should check resumed slaves periodically.

      Note that if I stop foo at this point then both writes and reads go to bar. That is fine.
      Only the resumed slaves are not checked to send them read queries again.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: