Skip to content

Commit

Permalink
DBZ-848 Removed explicit primary node change handling. It is handled …
Browse files Browse the repository at this point in the history
…by mongoDb driver internally. Explicit primary node change event handling was causing issue that no mongo events were read after primary change. This issue only happened when rs.stepDown(<time s>) was used on mongo node.
  • Loading branch information
Tautvydas Januskevicius authored and tautautau committed Nov 26, 2018
1 parent 62fe7d1 commit f7a1c6a
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,9 @@ protected boolean handleOplogEvent(ServerAddress primaryAddress, Document event)
ServerAddress serverAddress = address.get();

if (serverAddress != null && !serverAddress.equals(primaryAddress)) {
logger.info("Found new primary event in oplog, so stopping use of {} to continue with new primary",
primaryAddress);
// There is a new primary, so stop using this server and instead use the new primary ...
return false;
//primary switch will be handled automatically by mongo driver.
logger.info("Found new primary event in oplog, so stopping use of {} to continue with new primary {}",
primaryAddress, serverAddress);
} else {
logger.info("Found new primary event in oplog, current {} is new primary. " +
"Continue to process oplog event.", primaryAddress);
Expand Down

0 comments on commit f7a1c6a

Please sign in to comment.