Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-5260

Debezium fails to connect to replicaset if a node is down

XMLWordPrintable

    • False
    • None
    • False
    • Hide

      Sample cluster Description

      ClusterDescription{type=REPLICA_SET, connectionMode=MULTIPLE, serverDescriptions=[    ServerDescription{address=host3:27018, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused (Connection refused)}},        ServerDescription{address=host1:27017, type=REPLICA_SET_PRIMARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=8, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=250551918, setName='my_rs', canonicalAddress=host1:27017, hosts=[host3:27018, host1:27017, host2:27017], passives=[], arbiters=[], primary='host1:27017', tagSet=TagSet{[]}, electionId=7fffffff0000000000000028, setVersion=230426, topologyVersion=null, lastWriteDate=Thu Jun 16 10:01:31 NZST 2022, lastUpdateTimeNanos=2886106989449450},        ServerDescription{address=host2:27017, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=8, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=347435616, setName='my_rs', canonicalAddress=host2:27017, hosts=[host3:27018, host1, host2:27017], passives=[], arbiters=[], primary='host1:27017', tagSet=TagSet{[]}, electionId=null, setVersion=230426, topologyVersion=null, lastWriteDate=Thu Jun 16 10:01:31 NZST 2022, lastUpdateTimeNanos=2886107729759236}]} 
      Show
      Sample cluster Description ClusterDescription{type=REPLICA_SET, connectionMode=MULTIPLE, serverDescriptions=[ ServerDescription{address=host3:27018, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused (Connection refused)}}, ServerDescription{address=host1:27017, type=REPLICA_SET_PRIMARY, state=CONNECTED, ok= true , minWireVersion=0, maxWireVersion=8, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=250551918, setName= 'my_rs' , canonicalAddress=host1:27017, hosts=[host3:27018, host1:27017, host2:27017], passives=[], arbiters=[], primary= 'host1:27017' , tagSet=TagSet{[]}, electionId=7fffffff0000000000000028, setVersion=230426, topologyVersion= null , lastWriteDate=Thu Jun 16 10:01:31 NZST 2022, lastUpdateTimeNanos=2886106989449450}, ServerDescription{address=host2:27017, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok= true , minWireVersion=0, maxWireVersion=8, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=347435616, setName= 'my_rs' , canonicalAddress=host2:27017, hosts=[host3:27018, host1, host2:27017], passives=[], arbiters=[], primary= 'host1:27017' , tagSet=TagSet{[]}, electionId= null , setVersion=230426, topologyVersion= null , lastWriteDate=Thu Jun 16 10:01:31 NZST 2022, lastUpdateTimeNanos=2886107729759236}]}

      In order to make your issue reports as actionable as possible, please provide the following information, depending on the issue type.

      Bug report

      For bug reports, provide this information, please:

      What Debezium connector do you use and what version?

      Mongo Debezium connector 1.9.3.final

      What is the connector configuration?

      Connecting to replicasets

      What is the captured database version and mode of depoyment?

      Mongo 4.2 self hosted

      What behaviour do you expect?

      When a secondary dies the connector should continue on fine.

      What behaviour do you see?

      When a secondary fails we end up with an error like:
      Unable to start MongoDB connector task since no replica sets were found at host1:27017,host2:27017,host3:27018

      Do you see the same behaviour using the latest relesead Debezium version?

      Yes

      Underlying issue

      Replica set name is not populated when first server in list is unavailable
      https://github.com/debezium/debezium/blob/main/debezium-connector-mongodb/src/main/java/io/debezium/connector/mongodb/ReplicaSetDiscovery.java#L99

      Workaround

      Disabling member discovery by setting `mongodb.members.auto.discover` to false

            Unassigned Unassigned
            tim-patterson Tim Patterson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: