public void Handle(SystemMessage.ChaserCaughtUp received) { if (_managerState != ManagerState.WaitingForChaser) { // will get this in prereplica and prereadonly replica Ignore(received, "Not waiting for chaser."); } else if (received.CorrelationId != _stateCorrelationId) { Ignore( received, "Current correlation id is {currentCorrelationId} but received {receivedCorrelationId}.", _stateCorrelationId, received.CorrelationId); } else { Respond( received, new SystemMessage.WriteEpoch(_currentEpochNumber), "currentEpochNumber {currentEpochNumber}.", _currentEpochNumber); _managerState = ManagerState.WritingEpoch; } }
private void HandleAsPreReplica(SystemMessage.ChaserCaughtUp message) { if (_master == null) { throw new Exception("_master == null"); } if (_stateCorrelationId != message.CorrelationId) { return; } _outputBus.Publish(message); _fsm.Handle(new ReplicationMessage.SubscribeToMaster(_stateCorrelationId, _master.InstanceId, Guid.NewGuid())); }
private void HandleAsPreMaster(SystemMessage.ChaserCaughtUp message) { if (_master == null) { throw new Exception("_master == null"); } if (_stateCorrelationId != message.CorrelationId) { return; } _outputBus.Publish(message); _fsm.Handle(new SystemMessage.BecomeMaster(_stateCorrelationId, _lastEpochId)); }
private void Handle(SystemMessage.ChaserCaughtUp message) { _outputBus.Publish(message); _fsm.Handle(new SystemMessage.BecomeMaster(Guid.NewGuid())); }