-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.8.0
-
Component/s: Server Selection
-
None
-
Environment:Debian stretch
mongo-server 3.4.16
After upgrading from our mongo-ruby-driver fork (based on 2.4.2) to the official 2.8.0 release, we performed a failover and noticed a bunch of different types of exceptions.
Our topology was the following:
- oldprimary.example.com:27025 was the primary before the failover
- newprimary.example.com:27025 became the new primary
- baz.example.com:27025 was the arbiter before/after the failover
1. Mongo::Error::NoServerAvailable
Error:
No primary server is available in cluster: #<Cluster topology=ReplicaSetNoPrimary[oldprimary.example.com:27025,newprimary.example.com:27025,baz.example.com:27025,name=test,v=101734,e=5badef77446cd23001740b12] servers=[#<Server address=oldprimary.example.com:27025 UNKNOWN>,#<Server address=newprimary.example.com:27025 SECONDARY replica_set=test>,#<Server address=baz.example.com:27025 UNKNOWN>]> with timeout=30, LT=0.015. The following servers have dead monitor threads: #<Server address=oldprimary.example.com:27025 UNKNOWN>, #<Server address=newprimary.example.com:27025 SECONDARY replica_set=test>, #<Server address=baz.example.com:27025 UNKNOWN>. The cluster is disconnected (client may have been closed)
Backtrace:
from mongo/server_selector/selectable.rb:184:in `select_server' from mongo/collection/view/readable.rb:148:in `block (2 levels) in count' from mongo/retryable.rb:43:in `read_with_retry' from mongo/collection/view/readable.rb:147:in `block in count' from mongo/cluster.rb:651:in `with_session' from mongo/client.rb:663:in `with_session' from mongo/collection/view.rb:204:in `with_session' from mongo/collection/view/readable.rb:146:in `count' from mongoid/contextual/mongo.rb:71:in `block in count' from mongoid/contextual/mongo.rb:522:in `try_cache' from mongoid/contextual/mongo.rb:71:in `count' from mongoid/contextual.rb:20:in `count' from mongoid/findable.rb:55:in `count'
2. Mongo::Error::OperationFailure
Error:
Mongo::Error::OperationFailure: not master and slaveOk=false (13435)
Backtrace:
Mongo::Error::OperationFailure: not master and slaveOk=false (13435)
from mongo/operation/result.rb:270:in `raise_operation_failure'
from mongo/operation/result.rb:266:in `validate!'
from mongo/operation/shared/executable.rb:26:in `execute'
from mongo/operation/shared/op_msg_or_command.rb:27:in `execute'
from mongo/collection/view/readable.rb:156:in `block (2 levels) in count'
from mongo/retryable.rb:43:in `read_with_retry'
from mongo/collection/view/readable.rb:147:in `block in count'
from mongo/cluster.rb:651:in `with_session'
from mongo/client.rb:663:in `with_session'
from mongo/collection/view.rb:204:in `with_session'
from mongo/collection/view/readable.rb:146:in `count'
from mongoid/contextual/mongo.rb:71:in `block in count'
from mongoid/contextual/mongo.rb:522:in `try_cache'
from mongoid/contextual/mongo.rb:71:in `count'
from mongoid/contextual.rb:20:in `count'
- is duplicated by
-
RUBY-1893 Exceptions thrown: primary node UNKNOW
- Closed