Skip to content

Commit 0e5a87e

Browse files
committed
Revert "Remove redundant logging of maxElectionId/maxSetVersion (#902)"
This reverts commit f0f1090. JAVA-4550
1 parent eb35443 commit 0e5a87e

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

driver-core/src/main/com/mongodb/internal/connection/AbstractMultiServerCluster.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -252,14 +252,11 @@ private boolean handleReplicaSetMemberChanged(final ServerDescription newDescrip
252252
}
253253

254254
if (newDescription.isPrimary()) {
255-
if (isNonStalePrimary(newDescription.getElectionId(), newDescription.getSetVersion())) {
256-
if (nullSafeCompareTo(newDescription.getElectionId(), maxElectionId) != 0
257-
|| nullSafeCompareTo(newDescription.getSetVersion(), maxSetVersion) != 0) {
258-
LOGGER.info(format("Setting max election id to %s and max set version to %d from replica set primary %s",
259-
newDescription.getElectionId(), newDescription.getSetVersion(), newDescription.getAddress()));
260-
maxElectionId = newDescription.getElectionId();
261-
maxSetVersion = newDescription.getSetVersion();
262-
}
255+
if (isNonStalePrimary(newDescription.getElectionId(), newDescription.getSetVersion())) {
256+
LOGGER.info(format("Setting max election id to %s and max set version to %d from replica set primary %s",
257+
newDescription.getElectionId(), newDescription.getSetVersion(), newDescription.getAddress()));
258+
maxElectionId = newDescription.getElectionId();
259+
maxSetVersion = newDescription.getSetVersion();
263260
} else {
264261
LOGGER.info(format("Invalidating potential primary %s whose (set version, election id) tuple of (%d, %s) "
265262
+ "is less than one already seen of (%d, %s)",

0 commit comments

Comments
 (0)