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

SDAM events are not published when server is marked unknown during handshake

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.7.0.rc0
    • Affects Version/s: None
    • Component/s: Spec Comp
    • None

      Running a command when invalid credentials are given:

      irb(main):008:0> a.database.command(ismaster:1)
      D, [2018-09-25T00:24:09.164289 #16241] DEBUG -- : MONGODB | localhost:27101 | admin.ismaster | STARTED | {"ismaster"=>1, "$readPreference"=>{"mode"=>"primary"}, "$clusterTime"=>{"clusterTime"=>#<BSON::Timestamp:0x00005596177c3d48 @seconds=1537849395, @increment=1>, "signature"=>{"hash"=><BSON::Binary:0x47051563736600 type=generic data=0x0000000000000000....
      D, [2018-09-25T00:24:09.166836 #16241] DEBUG -- : MONGODB | localhost:27101 | admin.saslStart | STARTED | {}
      D, [2018-09-25T00:24:09.167862 #16241] DEBUG -- : MONGODB | localhost:27101 | admin.saslStart | FAILED | Authentication failed. (18) | 0.000915457s
      D, [2018-09-25T00:24:09.168255 #16241] DEBUG -- : MONGODB | localhost:27101 | admin.ismaster | FAILED | User hai is not authorized to access admin. | 0.00391504s
      Traceback (most recent call last):
             16: from /home/me/apps/mongo/ruby-driver/lib/mongo/server/connection_pool.rb:110:in `with_connection'
             15: from /home/me/apps/mongo/ruby-driver/lib/mongo/operation/shared/executable.rb:34:in `block in dispatch_message'
             14: from /home/me/apps/mongo/ruby-driver/lib/mongo/server/connection.rb:169:in `dispatch'
             13: from /home/me/apps/mongo/ruby-driver/lib/mongo/monitoring/publishable.rb:48:in `publish_command'
             12: from /home/me/apps/mongo/ruby-driver/lib/mongo/server/connection.rb:170:in `block in dispatch'
             11: from /home/me/apps/mongo/ruby-driver/lib/mongo/server/connection.rb:229:in `deliver'
             10: from /home/me/apps/mongo/ruby-driver/lib/mongo/server/connection.rb:282:in `write'
              9: from /home/me/apps/mongo/ruby-driver/lib/mongo/server/connectable.rb:84:in `ensure_connected'
              8: from /home/me/apps/mongo/ruby-driver/lib/mongo/server/connection.rb:126:in `connect!'
              7: from /home/me/apps/mongo/ruby-driver/lib/mongo/server/connection.rb:260:in `authenticate!'
              6: from /home/me/apps/mongo/ruby-driver/lib/mongo/server.rb:305:in `handle_auth_failure!'
              5: from /home/me/apps/mongo/ruby-driver/lib/mongo/server/connection.rb:261:in `block in authenticate!'
              4: from /home/me/apps/mongo/ruby-driver/lib/mongo/auth/scram.rb:77:in `login'
              3: from /home/me/apps/mongo/ruby-driver/lib/mongo/auth/scram/conversation.rb:115:in `continue'
              2: from /home/me/apps/mongo/ruby-driver/lib/mongo/auth/scram/conversation.rb:503:in `validate_first_message!'
              1: from /home/me/apps/mongo/ruby-driver/lib/mongo/auth/scram/conversation.rb:508:in `validate!'
      Mongo::Auth::Unauthorized (User hai is not authorized to access admin.)
      irb(main):009:0> D, [2018-09-25T00:24:18.740283 #16241] DEBUG -- : MONGODB | EVENT: #<Mongo::Monitoring::Event::ServerDescriptionChanged>
      D, [2018-09-25T00:24:18.740441 #16241] DEBUG -- : MONGODB | Server description for localhost:27101 changed from 'unknown' to 'primary'.
      D, [2018-09-25T00:24:18.740889 #16241] DEBUG -- : MONGODB | EVENT: #<TopologyChanged prev=ReplicaSetWithPrimary new=ReplicaSetWithPrimary>
      D, [2018-09-25T00:24:18.741016 #16241] DEBUG -- : MONGODB | Topology type 'replicasetwithprimary' changed to type 'replicasetwithprimary'.
      

      There is an event for server description transition from unknown to primary but there is no event for primary to unknown transition. A primary becoming unknown should also change topology description to no primary methinks.

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: