diff --git a/lib/mongo/session.rb b/lib/mongo/session.rb index 27d84d580d..c5a55fd168 100644 --- a/lib/mongo/session.rb +++ b/lib/mongo/session.rb @@ -1200,7 +1200,7 @@ def check_if_ended! end def check_matching_client!(client) - if @client != client + if @client.cluster != client.cluster raise Mongo::Error::InvalidSession.new(MISMATCHED_CLUSTER_ERROR_MSG) end end