Exemple #1
0
        private WriteResult ExecuteCommand(DxStoreCommand command, WriteOptions options, TimeSpan timeout)
        {
            WriteResult writeResult = null;

            command.Initialize(this.instance.GroupConfig.Self, options);
            if (options != null && (options.IsPerformTestUpdate || options.IsWaitRequired()))
            {
                if (options.IsPerformTestUpdate)
                {
                    this.EnsureTestUpdateIsSuccessful(command, options, timeout);
                }
                writeResult = this.ExecuteCommandWithAck(command, options, true, timeout);
                if (!writeResult.IsConstraintPassed)
                {
                    this.instance.EventLogger.Log(DxEventSeverity.Warning, 0, "{0}: Failed to satisfy constraint in the second attempt. Updates will eventually catch up", new object[]
                    {
                        this.instance.GroupConfig.Identity
                    });
                }
            }
            else
            {
                this.instance.StateMachine.ReplicateCommand(command, new TimeSpan?(timeout));
            }
            return(writeResult);
        }
Exemple #2
0
 private void InitializeCommand(DxStoreCommand command, WriteOptions options)
 {
     command.TimeInitiated = DateTimeOffset.Now;
     command.Initiator     = this.instance.GroupConfig.Self;
     if (options != null)
     {
         command.IsNotifyInitiator = options.IsWaitRequired();
     }
 }