Mongo Java driver 3.7.1 not able to detect newly elected primary


My replica-set configuration looks as below:

Member1 - Primary(Priority 5)
Member2 - Secondary(Priority 4)
Member3 - Secondary(Priority 3)
Member4 - Secondary(Priority 2)
Member5 - Arbiter

I shutdown Member1 & Member2 and As I expected Member3 becomes primary. Logged in Mongo shell and confirmed the same using rs.status().

I wrote a java program which regularly execute “mongo.getReplicaSetStatus().getMaster()”. After Member1 & Member2 shutdown I dont get Member3 as Master.

I get below info log from driver code:

INFO: Invalidating potential primary Member3:37718 whose (set version, election id) tuple of (167606, 6102d8fb4cfa71b36db6292d) is less than one already seen of (167606, 6102d90df05b8b74b24fa1b5)

Mongo Server Version : 3.6.17
Mongo Driver Version :3.7.1
Cent OS : 8
JDK : 1.8
Storage Engine: mmapV1

Can anyone help me to understand why member3 is not detected as primary also please explain what is mean of info log statement.

is it known issue? any workaround available please suggest.


This problem was resolved when protocolVersion set to 1 .