Пример #1
0
        public override void AssertPutCommandToLeader(CommandBase cmd)
        {
            var commandName = cmd.GetType().Name;

            if (ClusterCommandsVersionManager.CanPutCommand(commandName) == false)
            {
                RejectPutClusterCommandException.Throw($"Cannot accept the command '{commandName}', " +
                                                       $"because the cluster version is '{ClusterCommandsVersionManager.CurrentClusterMinimalVersion}', " +
                                                       $"while this command can be applied in cluster with minimum version of {ClusterCommandsVersionManager.ClusterCommandsVersions[commandName]}");
            }
        }
Пример #2
0
        public override void AssertPutCommandToLeader(CommandBase cmd)
        {
            var commandName = cmd.GetType().Name;

            if (ClusterCommandsVersionManager.CanPutCommand(commandName) == false)
            {
                RejectPutClusterCommandException.Throw($"Cannot accept the command '{commandName}', " +
                                                       $"because the cluster version is '{ClusterCommandsVersionManager.CurrentClusterMinimalVersion}', " +
                                                       $"while this command can be applied in cluster with minimum version of {ClusterCommandsVersionManager.ClusterCommandsVersions[commandName]}");
            }

            if (cmd.UniqueRequestId == null)
            {
                RejectPutClusterCommandException.Throw($"The command {commandName} doesn't contain the raft request unique identifier.");
            }
        }