You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by Jonathan Ellis <jb...@gmail.com> on 2009/11/04 22:25:39 UTC

gossip & partitioning

There's some code in StorageService.onChange that looks like this:

        // if there is no token data in the endpointstate
            /*
             * If we are here and if this node is UP and already has an entry
             * in the token map. It means that the node was behind a
network partition.
            */
            if ( epState.isAlive() && tokenMetadata_.isKnownEndPoint(endpoint) )
            {
                logger_.debug("EndPoint " + ep + " just recovered from
a partition. Sending hinted data.");
                // send hinted handoffs
            }

I don't see how you could actually have null token data.  Since token
(NODE_ID) is the first thing a node gossips, and is required for an
entry to be added to tokenMetadata, I don't see how that could
disappear from EndPointState.  My understanding is that Gossiper never
actually discards data from EndPointState, only updates it with
more-current information (see applyApplicationStateLocally).

Am I missing something, or can this part of onChange be safely removed?

-Jonathan

Re: gossip & partitioning

Posted by Jonathan Ellis <jb...@gmail.com>.
Yes, I was missing something.  EndPointState is maintained in its
entirety for each node in Gossiper, but onChange is called on EPS
containing only a single "delta" key.

On Wed, Nov 4, 2009 at 3:25 PM, Jonathan Ellis <jb...@gmail.com> wrote:
> There's some code in StorageService.onChange that looks like this:
>
>        // if there is no token data in the endpointstate
>            /*
>             * If we are here and if this node is UP and already has an entry
>             * in the token map. It means that the node was behind a
> network partition.
>            */
>            if ( epState.isAlive() && tokenMetadata_.isKnownEndPoint(endpoint) )
>            {
>                logger_.debug("EndPoint " + ep + " just recovered from
> a partition. Sending hinted data.");
>                // send hinted handoffs
>            }
>
> I don't see how you could actually have null token data.  Since token
> (NODE_ID) is the first thing a node gossips, and is required for an
> entry to be added to tokenMetadata, I don't see how that could
> disappear from EndPointState.  My understanding is that Gossiper never
> actually discards data from EndPointState, only updates it with
> more-current information (see applyApplicationStateLocally).
>
> Am I missing something, or can this part of onChange be safely removed?
>
> -Jonathan
>