Ejemplo n.º 1
0
 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;
     }
 }
Ejemplo n.º 2
0
 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()));
 }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
 private void Handle(SystemMessage.ChaserCaughtUp message)
 {
     _outputBus.Publish(message);
     _fsm.Handle(new SystemMessage.BecomeMaster(Guid.NewGuid()));
 }