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

MongoShardedClient does not support read preferences correctly

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 1.8.3
    • Affects Version/s: 1.8.0, 1.8.1, 1.8.2
    • Component/s: 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@mongodb.com Durran Jordan
            Reporter:
            brandon.black@10gen.com Brandon Black
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: