MongoShardedClient does not support read preferences correctly

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Critical - P2
    • 1.8.3
    • Affects Version/s: 1.8.0, 1.8.1, 1.8.2
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The following works:

      client = Mongo::MongoShardedClient.new("brandonblack-mbpr.local:3333", :read => :secondary_preferred)
      client['database']['collection'].find_one()
      
      client = Mongo::MongoShardedClient.new("brandonblack-mbpr.local:3333", :read => :primary)
      client['database']['collection'].find_one()
      

      However, this does not:

      client = Mongo::MongoShardedClient.new("brandonblack-mbpr.local:3333", :read => :secondary)
      client['database']['collection'].find_one()
      => SystemStackError: stack level too deep
      
      client = Mongo::MongoShardedClient.new("brandonblack-mbpr.local:3333", :read => :primary_preferred)
      client['database']['collection'].find_one()
      => Mongo::OperationFailure: wrong type for field (mode) 14 != 2
      

              Assignee:
              Durran Jordan
              Reporter:
              Brandon Black (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: