When there are no known changes to the node ring a `GossipStatus` initiates a gossip chat between two members. If the receiver has a newer version it replies with a `GossipEnvelope`. If receiver has older version it replies with its `GossipStatus`. Same versions ends the chat immediately.
Inheritance: IClusterMessage
示例#1
0
 protected bool Equals(GossipStatus other)
 {
     return _from.Equals(other._from) && _version.IsSameAs(other._version);
 }
示例#2
0
 /// <inheritdoc/>
 protected bool Equals(GossipStatus other)
 {
     return(_from.Equals(other._from) && _version.IsSameAs(other._version));
 }
示例#3
0
        public void ReceiveGossipStatus(GossipStatus status)
        {
            var from = status.From;
            if (!_latestGossip.Overview.Reachability.IsReachable(SelfUniqueAddress, from))
                _log.Info("Ignoring received gossip status from unreachable [{0}]", from);
            else if (_latestGossip.Members.All(m => !m.UniqueAddress.Equals(from)))
                _log.Debug("Cluster Node [{0}] - Ignoring received gossip status from unknown [{1}]",
                    _cluster.SelfAddress, from);
            else
            {
                var comparison = status.Version.CompareTo(_latestGossip.Version);
                switch (comparison)
                {
                    case VectorClock.Ordering.Same:
                        //same version
                        break;
                    case VectorClock.Ordering.After:
                        GossipStatusTo(from, Sender); //remote is newer
                        break;
                    default:
                        GossipTo(from, Sender); //conflicting or local is newer
                        break;
                }
            }

        }