|
Hi Jeffrey,
Thank you for the quick support.
Here is the rs.status() (local cluster) :
{ set: 'rs0', date: 2022-12-01T15:05:40.812Z, myState: 1, term: Long("2108"), syncSourceHost: '', syncSourceId: -1, heartbeatIntervalMillis: Long("2000"), majorityVoteCount: 2, writeMajorityCount: 2, votingMembersCount: 3, writableVotingMembersCount: 2, optimes: { lastCommittedOpTime: { ts: Timestamp({ t: 1669907133, i: 1 }), t: Long("2108") }, lastCommittedWallTime: 2022-12-01T15:05:33.287Z, readConcernMajorityOpTime: { ts: Timestamp({ t: 1669907133, i: 1 }), t: Long("2108") }, appliedOpTime: { ts: Timestamp({ t: 1669907133, i: 1 }), t: Long("2108") }, durableOpTime: { ts: Timestamp({ t: 1669907133, i: 1 }), t: Long("2108") }, lastAppliedWallTime: 2022-12-01T15:05:33.287Z, lastDurableWallTime: 2022-12-01T15:05:33.287Z }, lastStableRecoveryTimestamp: Timestamp({ t: 1669907083, i: 1 }), electionCandidateMetrics: { lastElectionReason: 'priorityTakeover', lastElectionDate: 2022-12-01T12:19:58.946Z, electionTerm: Long("2108"), lastCommittedOpTimeAtElection: { ts: Timestamp({ t: 1669897197, i: 1 }), t: Long("2107") }, lastSeenOpTimeAtElection: { ts: Timestamp({ t: 1669897197, i: 1 }), t: Long("2107") }, numVotesNeeded: 2, priorityAtElection: 100, electionTimeoutMillis: Long("10000"), priorPrimaryMemberId: 1, numCatchUpOps: Long("0"), newTermStartDate: 2022-12-01T12:19:59.035Z, wMajorityWriteAvailabilityDate: 2022-12-01T12:20:00.009Z }, electionParticipantMetrics: { votedForCandidate: true, electionTerm: Long("2107"), lastVoteDate: 2022-12-01T12:19:47.683Z, electionCandidateMemberId: 1, voteReason: '', lastAppliedOpTimeAtElection: { ts: Timestamp({ t: 1669897177, i: 1 }), t: Long("2106") }, maxAppliedOpTimeInSet: { ts: Timestamp({ t: 1669897177, i: 1 }), t: Long("2106") }, priorityAtElection: 100 }, members: [ { _id: 0, name: '127.0.0.1:27017', health: 1, state: 1, stateStr: 'PRIMARY', uptime: 1114780, optime: [Object], optimeDate: 2022-12-01T15:05:33.000Z, lastAppliedWallTime: 2022-12-01T15:05:33.287Z, lastDurableWallTime: 2022-12-01T15:05:33.287Z, syncSourceHost: '', syncSourceId: -1, infoMessage: '', electionTime: Timestamp({ t: 1669897198, i: 1 }), electionDate: 2022-12-01T12:19:58.000Z, configVersion: 1, configTerm: 2108, self: true, lastHeartbeatMessage: '' }, { _id: 1, name: '127.0.0.1:27018', health: 1, state: 2, stateStr: 'SECONDARY', uptime: 9963, optime: [Object], optimeDurable: [Object], optimeDate: 2022-12-01T15:05:33.000Z, optimeDurableDate: 2022-12-01T15:05:33.000Z, lastAppliedWallTime: 2022-12-01T15:05:33.287Z, lastDurableWallTime: 2022-12-01T15:05:33.287Z, lastHeartbeat: 2022-12-01T15:05:39.691Z, lastHeartbeatRecv: 2022-12-01T15:05:40.398Z, pingMs: Long("0"), lastHeartbeatMessage: '', syncSourceHost: '127.0.0.1:27017', syncSourceId: 0, infoMessage: '', configVersion: 1, configTerm: 2108 }, { _id: 2, name: '127.0.0.1:27019', health: 1, state: 7, stateStr: 'ARBITER', uptime: 9963, lastHeartbeat: 2022-12-01T15:05:39.691Z, lastHeartbeatRecv: 2022-12-01T15:05:39.416Z, pingMs: Long("0"), lastHeartbeatMessage: '', syncSourceHost: '', syncSourceId: -1, infoMessage: '', configVersion: 1, configTerm: 2108 } ], ok: 1, '$clusterTime': { clusterTime: Timestamp({ t: 1669907133, i: 1 }), signature: { hash: Binary(Buffer.from("0000000000000000000000000000000000000000", "hex"), 0), keyId: Long("0") } }, operationTime: Timestamp({ t: 1669907133, i: 1 })}
|
Debug from the diver (org.mongo) :
2022-12-01 16:17:10 [INFO ] org.mongodb.driver.cluster Adding discovered server 127.0.0.1:27018 to client view of cluster
|
2022-12-01 16:17:10 [INFO ] org.mongodb.driver.cluster Adding discovered server localhost:27017 to client view of cluster
|
2022-12-01 16:17:10 [DEBUG] org.mongodb.driver.cluster Updating cluster description to {type=REPLICA_SET, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING}, {address=127.0.0.1:27018, type=UNKNOWN, state=CONNECTING}]
|
2022-12-01 16:17:10 [DEBUG] org.mongodb.driver.connection Opened connection [connectionId{localValue:1, serverValue:3359}] to localhost:27017
|
2022-12-01 16:17:10 [DEBUG] org.mongodb.driver.connection Opened connection [connectionId{localValue:3, serverValue:3812}] to 127.0.0.1:27018
|
2022-12-01 16:17:10 [DEBUG] org.mongodb.driver.connection Opened connection [connectionId{localValue:4, serverValue:3360}] to localhost:27017
|
2022-12-01 16:17:10 [DEBUG] org.mongodb.driver.connection Opened connection [connectionId{localValue:2, serverValue:3813}] to 127.0.0.1:27018
|
2022-12-01 16:17:10 [INFO ] org.mongodb.driver.cluster Monitor thread successfully connected to server with description ServerDescription{address=localhost:27017, type=REPLICA_SET_PRIMARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=13, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=77683719, setName='rs0', canonicalAddress=127.0.0.1:27017, hosts=[127.0.0.1:27017, 127.0.0.1:27018], passives=[], arbiters=[127.0.0.1:27019], primary='127.0.0.1:27017', tagSet=TagSet{[]}, electionId=7fffffff000000000000083c, setVersion=1, topologyVersion=TopologyVersion{processId=6377c02881867a66f6c2b5f5, counter=1056}, lastWriteDate=Thu Dec 01 15:17:03 UTC 2022, lastUpdateTimeNanos=303942136167388}
|
2022-12-01 16:17:10 [INFO ] org.mongodb.driver.cluster Monitor thread successfully connected to server with description ServerDescription{address=127.0.0.1:27018, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=13, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=77747506, setName='rs0', canonicalAddress=127.0.0.1:27018, hosts=[127.0.0.1:27017, 127.0.0.1:27018], passives=[], arbiters=[127.0.0.1:27019], primary='127.0.0.1:27017', tagSet=TagSet{[]}, electionId=null, setVersion=1, topologyVersion=TopologyVersion{processId=6377c029d83b658f8610ef42, counter=904}, lastWriteDate=Thu Dec 01 15:17:03 UTC 2022, lastUpdateTimeNanos=303942136167433}
|
2022-12-01 16:17:10 [INFO ] org.mongodb.driver.client MongoClient with metadata {"driver": {"name": "mongo-java-driver|sync", "version": "4.8.0"}, "os": {"type": "Darwin", "name": "Mac OS X", "architecture": "x86_64", "version": "10.16"}, "platform": "Java/AdoptOpenJDK/1.8.0_292-b10"} created with settings MongoClientSettings{readPreference=primary, writeConcern=WriteConcern{w=null, wTimeout=null ms, journal=null}, retryWrites=true, retryReads=true, readConcern=ReadConcern{level=null}, credential=null, streamFactoryFactory=null, commandListeners=[], codecRegistry=ProvidersCodecRegistry{codecProviders=[ProvidersCodecRegistry{codecProviders=[ValueCodecProvider{}, BsonValueCodecProvider{}, DBRefCodecProvider{}, DBObjectCodecProvider{}, DocumentCodecProvider{}, CollectionCodecProvider{}, IterableCodecProvider{}, MapCodecProvider{}, GeoJsonCodecProvider{}, GridFSFileCodecProvider{}, Jsr310CodecProvider{}, JsonObjectCodecProvider{}, BsonCodecProvider{}, EnumCodecProvider{}, com.mongodb.Jep395RecordCodecProvider@31866cc0]}, ProvidersCodecRegistry{codecProviders=[org.bson.codecs.pojo.PojoCodecProvider@16a39e9e]}]}, clusterSettings={hosts=[127.0.0.1:27018, localhost:27017], srvServiceName=mongodb, mode=MULTIPLE, requiredClusterType=REPLICA_SET, requiredReplicaSetName='rs0', serverSelector='null', clusterListeners='[]', serverSelectionTimeout='30000 ms', localThreshold='30000 ms'}, socketSettings=SocketSettings{connectTimeoutMS=10000, readTimeoutMS=0, receiveBufferSize=0, sendBufferSize=0}, heartbeatSocketSettings=SocketSettings{connectTimeoutMS=10000, readTimeoutMS=10000, receiveBufferSize=0, sendBufferSize=0}, connectionPoolSettings=ConnectionPoolSettings{maxSize=100, minSize=0, maxWaitTimeMS=120000, maxConnectionLifeTimeMS=0, maxConnectionIdleTimeMS=0, maintenanceInitialDelayMS=0, maintenanceFrequencyMS=60000, connectionPoolListeners=[], maxConnecting=2}, serverSettings=ServerSettings{heartbeatFrequencyMS=10000, minHeartbeatFrequencyMS=500, serverListeners='[]', serverMonitorListeners='[]'}, sslSettings=SslSettings{enabled=false, invalidHostNameAllowed=false, context=null}, applicationName='null', compressorList=[], uuidRepresentation=UNSPECIFIED, serverApi=null, autoEncryptionSettings=null, contextProvider=null}
|
2022-12-01 16:17:10 [DEBUG] org.mongodb.driver.connection Marking the connection pool for ServerId{clusterId=ClusterId{value='6388c5767b7dc612df9baf70', description='null'}, address=127.0.0.1:27018} as 'ready'
|
2022-12-01 16:17:10 [DEBUG] org.mongodb.driver.connection Pruning pooled connections to 127.0.0.1:27018
|
2022-12-01 16:17:10 [TRACE] org.mongodb.driver.cluster Handling description changed event for server 127.0.0.1:27018 with description ServerDescription{address=127.0.0.1:27018, type=REPLICA_SET_SECONDARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=13, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=77747506, setName='rs0', canonicalAddress=127.0.0.1:27018, hosts=[127.0.0.1:27017, 127.0.0.1:27018], passives=[], arbiters=[127.0.0.1:27019], primary='127.0.0.1:27017', tagSet=TagSet{[]}, electionId=null, setVersion=1, topologyVersion=TopologyVersion{processId=6377c029d83b658f8610ef42, counter=904}, lastWriteDate=Thu Dec 01 15:17:03 UTC 2022, lastUpdateTimeNanos=303942136167433}
|
2022-12-01 16:17:10 [INFO ] org.mongodb.driver.cluster Adding discovered server 127.0.0.1:27017 to client view of cluster
|
2022-12-01 16:17:10 [INFO ] org.mongodb.driver.cluster Adding discovered server 127.0.0.1:27019 to client view of cluster
|
2022-12-01 16:17:10 [DEBUG] org.mongodb.driver.cluster Updating cluster description to {type=REPLICA_SET, servers=[{address=localhost:27017, type=UNKNOWN, state=CONNECTING}, {address=127.0.0.1:27019, type=UNKNOWN, state=CONNECTING}, {address=127.0.0.1:27018, type=REPLICA_SET_SECONDARY, roundTripTime=77.7 ms, state=CONNECTED}, {address=127.0.0.1:27017, type=UNKNOWN, state=CONNECTING}]
|
2022-12-01 16:17:10 [DEBUG] org.mongodb.driver.cluster Checking status of 127.0.0.1:27018
|
2022-12-01 16:17:10 [DEBUG] org.mongodb.driver.connection Marking the connection pool for ServerId{clusterId=ClusterId{value='6388c5767b7dc612df9baf70', description='null'}, address=localhost:27017} as 'ready'
|
2022-12-01 16:17:10 [TRACE] org.mongodb.driver.cluster Handling description changed event for server localhost:27017 with description ServerDescription{address=localhost:27017, type=REPLICA_SET_PRIMARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=13, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=77683719, setName='rs0', canonicalAddress=127.0.0.1:27017, hosts=[127.0.0.1:27017, 127.0.0.1:27018], passives=[], arbiters=[127.0.0.1:27019], primary='127.0.0.1:27017', tagSet=TagSet{[]}, electionId=7fffffff000000000000083c, setVersion=1, topologyVersion=TopologyVersion{processId=6377c02881867a66f6c2b5f5, counter=1056}, lastWriteDate=Thu Dec 01 15:17:03 UTC 2022, lastUpdateTimeNanos=303942136167388}
|
2022-12-01 16:17:10 [DEBUG] org.mongodb.driver.connection Pruning pooled connections to localhost:27017
|
2022-12-01 16:17:10 [INFO ] org.mongodb.driver.cluster Server localhost:27017 is no longer a member of the replica set. Removing from client view of cluster.
|
2022-12-01 16:17:10 [DEBUG] org.mongodb.driver.connection Opened connection [connectionId{localValue:5, serverValue:3361}] to 127.0.0.1:27017
|
2022-12-01 16:17:10 [INFO ] org.mongodb.driver.cluster Monitor thread successfully connected to server with description ServerDescription{address=127.0.0.1:27017, type=REPLICA_SET_PRIMARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=13, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=6488519, setName='rs0', canonicalAddress=127.0.0.1:27017, hosts=[127.0.0.1:27017, 127.0.0.1:27018], passives=[], arbiters=[127.0.0.1:27019], primary='127.0.0.1:27017', tagSet=TagSet{[]}, electionId=7fffffff000000000000083c, setVersion=1, topologyVersion=TopologyVersion{processId=6377c02881867a66f6c2b5f5, counter=1056}, lastWriteDate=Thu Dec 01 15:17:03 UTC 2022, lastUpdateTimeNanos=303942154046105}
|
2022-12-01 16:17:10 [DEBUG] org.mongodb.driver.connection Opened connection [connectionId{localValue:7, serverValue:1471}] to 127.0.0.1:27019
|
2022-12-01 16:17:10 [DEBUG] org.mongodb.driver.connection Closing connection connectionId{localValue:4, serverValue:3360}
|
2022-12-01 16:17:10 [INFO ] org.mongodb.driver.cluster Monitor thread successfully connected to server with description ServerDescription{address=127.0.0.1:27019, type=REPLICA_SET_ARBITER, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=13, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=6084508, setName='rs0', canonicalAddress=127.0.0.1:27019, hosts=[127.0.0.1:27017, 127.0.0.1:27018], passives=[], arbiters=[127.0.0.1:27019], primary='127.0.0.1:27017', tagSet=TagSet{[]}, electionId=null, setVersion=1, topologyVersion=TopologyVersion{processId=6377c02afd13471e0a632423, counter=392}, lastWriteDate=Thu Dec 01 15:17:03 UTC 2022, lastUpdateTimeNanos=303942154578202}
|
2022-12-01 16:17:10 [DEBUG] org.mongodb.driver.connection Opened connection [connectionId{localValue:6, serverValue:3362}] to 127.0.0.1:27017
|
2022-12-01 16:17:10 [DEBUG] org.mongodb.driver.connection Closing connection connectionId{localValue:1, serverValue:3359}
|
2022-12-01 16:17:10 [DEBUG] org.mongodb.driver.connection Opened connection [connectionId{localValue:8, serverValue:1472}] to 127.0.0.1:27019
|
2022-12-01 16:17:10 [INFO ] org.mongodb.driver.cluster Discovered replica set primary localhost:27017 with max election id 7fffffff000000000000083c and max set version 1
|
2022-12-01 16:17:10 [DEBUG] org.mongodb.driver.connection Marking the connection pool for ServerId{clusterId=ClusterId{value='6388c5767b7dc612df9baf70', description='null'}, address=127.0.0.1:27017} as 'ready'
|
2022-12-01 16:17:10 [TRACE] org.mongodb.driver.cluster Handling description changed event for server 127.0.0.1:27017 with description ServerDescription{address=127.0.0.1:27017, type=REPLICA_SET_PRIMARY, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=13, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=6488519, setName='rs0', canonicalAddress=127.0.0.1:27017, hosts=[127.0.0.1:27017, 127.0.0.1:27018], passives=[], arbiters=[127.0.0.1:27019], primary='127.0.0.1:27017', tagSet=TagSet{[]}, electionId=7fffffff000000000000083c, setVersion=1, topologyVersion=TopologyVersion{processId=6377c02881867a66f6c2b5f5, counter=1056}, lastWriteDate=Thu Dec 01 15:17:03 UTC 2022, lastUpdateTimeNanos=303942154046105}
|
2022-12-01 16:17:10 [DEBUG] org.mongodb.driver.connection Pruning pooled connections to 127.0.0.1:27017
|
2022-12-01 16:17:10 [INFO ] org.mongodb.driver.cluster Discovered replica set primary 127.0.0.1:27017 with max election id 7fffffff000000000000083c and max set version 1
|
2022-12-01 16:17:10 [DEBUG] org.mongodb.driver.cluster Updating cluster description to {type=REPLICA_SET, servers=[{address=127.0.0.1:27019, type=UNKNOWN, state=CONNECTING}, {address=127.0.0.1:27018, type=REPLICA_SET_SECONDARY, roundTripTime=77.7 ms, state=CONNECTED}, {address=127.0.0.1:27017, type=REPLICA_SET_PRIMARY, roundTripTime=6.5 ms, state=CONNECTED}]
|
2022-12-01 16:17:10 [DEBUG] org.mongodb.driver.cluster Checking status of 127.0.0.1:27017
|
2022-12-01 16:17:11 [TRACE] org.mongodb.driver.cluster Handling description changed event for server 127.0.0.1:27019 with description ServerDescription{address=127.0.0.1:27019, type=REPLICA_SET_ARBITER, state=CONNECTED, ok=true, minWireVersion=0, maxWireVersion=13, maxDocumentSize=16777216, logicalSessionTimeoutMinutes=30, roundTripTimeNanos=6084508, setName='rs0', canonicalAddress=127.0.0.1:27019, hosts=[127.0.0.1:27017, 127.0.0.1:27018], passives=[], arbiters=[127.0.0.1:27019], primary='127.0.0.1:27017', tagSet=TagSet{[]}, electionId=null, setVersion=1, topologyVersion=TopologyVersion{processId=6377c02afd13471e0a632423, counter=392}, lastWriteDate=Thu Dec 01 15:17:03 UTC 2022, lastUpdateTimeNanos=303942154578202}
|
2022-12-01 16:17:11 [DEBUG] org.mongodb.driver.cluster Updating cluster description to {type=REPLICA_SET, servers=[{address=127.0.0.1:27019, type=REPLICA_SET_ARBITER, roundTripTime=6.1 ms, state=CONNECTED}, {address=127.0.0.1:27018, type=REPLICA_SET_SECONDARY, roundTripTime=77.7 ms, state=CONNECTED}, {address=127.0.0.1:27017, type=REPLICA_SET_PRIMARY, roundTripTime=6.5 ms, state=CONNECTED}]
|
2022-12-01 16:17:11 [DEBUG] org.mongodb.driver.cluster Checking status of 127.0.0.1:27019
|
Exception in thread "cluster-ClusterId{value='6388c5767b7dc612df9baf70', description='null'}-localhost:27017" com.mongodb.MongoInterruptedException: Interrupted waiting for lock
|
at com.mongodb.internal.Locks.checkedWithLock(Locks.java:49)
|
at com.mongodb.internal.Locks.withLock(Locks.java:36)
|
at com.mongodb.internal.Locks.withLock(Locks.java:29)
|
at com.mongodb.internal.connection.BaseCluster.withLock(BaseCluster.java:275)
|
at com.mongodb.internal.connection.AbstractMultiServerCluster.withLock(AbstractMultiServerCluster.java:54)
|
at com.mongodb.internal.connection.BaseCluster.updateDescription(BaseCluster.java:247)
|
at com.mongodb.internal.connection.AbstractMultiServerCluster.updateDescription(AbstractMultiServerCluster.java:385)
|
at com.mongodb.internal.connection.AbstractMultiServerCluster.lambda$onChange$3(AbstractMultiServerCluster.java:214)
|
at com.mongodb.internal.Locks.lambda$withLock$0(Locks.java:30)
|
at com.mongodb.internal.Locks.checkedWithLock(Locks.java:43)
|
at com.mongodb.internal.Locks.withLock(Locks.java:36)
|
at com.mongodb.internal.Locks.withLock(Locks.java:29)
|
at com.mongodb.internal.connection.BaseCluster.withLock(BaseCluster.java:275)
|
at com.mongodb.internal.connection.AbstractMultiServerCluster.withLock(AbstractMultiServerCluster.java:54)
|
at com.mongodb.internal.connection.AbstractMultiServerCluster.onChange(AbstractMultiServerCluster.java:164)
|
at com.mongodb.internal.connection.DefaultSdamServerDescriptionManager.updateDescription(DefaultSdamServerDescriptionManager.java:113)
|
at com.mongodb.internal.connection.DefaultSdamServerDescriptionManager.lambda$update$0(DefaultSdamServerDescriptionManager.java:75)
|
at com.mongodb.internal.Locks.lambda$withLock$0(Locks.java:30)
|
at com.mongodb.internal.Locks.checkedWithLock(Locks.java:43)
|
at com.mongodb.internal.Locks.withLock(Locks.java:36)
|
at com.mongodb.internal.Locks.withLock(Locks.java:29)
|
at com.mongodb.internal.connection.BaseCluster.withLock(BaseCluster.java:275)
|
at com.mongodb.internal.connection.AbstractMultiServerCluster.withLock(AbstractMultiServerCluster.java:54)
|
at com.mongodb.internal.connection.DefaultSdamServerDescriptionManager.update(DefaultSdamServerDescriptionManager.java:60)
|
at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:170)
|
at java.lang.Thread.run(Thread.java:748)
|
Caused by: java.lang.InterruptedException
|
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireInterruptibly(AbstractQueuedSynchronizer.java:1220)
|
at java.util.concurrent.locks.ReentrantLock.lockInterruptibly(ReentrantLock.java:335)
|
at com.mongodb.internal.Locks.checkedWithLock(Locks.java:41)
|
... 25 more
|
Good to hear that you are already on the virtual threads topic 
Feel free to ask more.
Regards,
|