else if ( path == null && event.getState() == Watcher.Event.KeeperState.SyncConnected )
{
long newSessionId = zooKeeper.getSessionId();
Pair<Master, Machine> masterBeforeIWrite = getMasterFromZooKeeper( false );
msgLog.logMessage( "Get master before write:" + masterBeforeIWrite );
<BUG>if ( newSessionId != sessionId || masterBeforeIWrite.other().getMachineId() != getCachedMaster().other().getMachineId() )
{</BUG>
sequenceNr = setup();
msgLog.logMessage( "Did setup, seq=" + sequenceNr + " new sessionId=" + newSessionId );
keeperState = KeeperState.SyncConnected;

else if ( path == null && event.getState() == Watcher.Event.KeeperState.SyncConnected )
{
long newSessionId = zooKeeper.getSessionId();
Pair<Master, Machine> masterBeforeIWrite = getMasterFromZooKeeper( false );
msgLog.logMessage( "Get master before write:" + masterBeforeIWrite );
boolean masterBeforeIWriteDiffers = masterBeforeIWrite.other().getMachineId() != getCachedMaster().other().getMachineId();
if ( newSessionId != sessionId || masterBeforeIWriteDiffers )
{
sequenceNr = setup();
msgLog.logMessage( "Did setup, seq=" + sequenceNr + " new sessionId=" + newSessionId );
keeperState = KeeperState.SyncConnected;
