[
https://issues.apache.org/jira/browse/CASSANDRA-5768?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13712030#comment-13712030
]
Jason Brown edited comment on CASSANDRA-5768 at 7/18/13 6:01 AM:
-----------------------------------------------------------------
lgtm. One (incredibly minor) optimization in Gossiper.checkSeedContact() would
be to check the boolean before checking the map for the seed ep, like this:
{code}protected void checkSeedContact(InetAddress ep)
{
if (!seedContacted && seeds.contains(ep))
seedContacted = true;
}
{code}
It could be that the effort of me writing this comment is greater than the
grand sum of all processing time saved by this optimization, but what the hell
:).
UPDATE: Thought about this some more, but what if you only have one seed in the
cluster, and that node is starting up, I'm not sure it will ever set the
Gossiper.seedContacted to true as it's only in the GossipDigest*VerbHandlers
where we call checkSeedContact(). Thus, the seed won't start up (unless I've
missed something).
Perhaps in Gossiper.buildSeedsList() we can do this:
{code}private void buildSeedsList()
{
List<InetAddress> seeds = DatabaseDescriptor.getSeeds();
for (InetAddress seed : seeds)
{
if (seed.equals(FBUtilities.getBroadcastAddress()) && seeds.size == 1)
seedContacted = true;
else
seeds.add(seed);
}
}{code}
(or something similar to this)
This way if there's only one seed (and this node is it), it can still come up.
Otherwise, if there are other seeds besides this one, maybe wait to set the
seedContacted? (not sure about that, though).
was (Author: jasobrown):
lgtm. One (incredibly minor) optimization in Gossiper.checkSeedContact()
would be to check the boolean before checking the map for the seed ep, like
this:
{code}protected void checkSeedContact(InetAddress ep)
{
if (!seedContacted && seeds.contains(ep))
seedContacted = true;
}
{code}
It could be that the effort of me writing this comment is greater than the
grand sum of all processing time saved by this optimization, but what the hell
:).
> If a Seed can't be contacted, a new node comes up as a cluster of 1
> -------------------------------------------------------------------
>
> Key: CASSANDRA-5768
> URL: https://issues.apache.org/jira/browse/CASSANDRA-5768
> Project: Cassandra
> Issue Type: Bug
> Affects Versions: 2.0 beta 1
> Reporter: Andy Cobley
> Assignee: Brandon Williams
> Priority: Minor
> Fix For: 2.0 beta 2
>
> Attachments: 5768.txt
>
>
> Setting up a new test cluster using 2.0.0-beta1 and I noticed the following
> behaviour with vnodes turned on.
> I bring up one node all well and good. however if I bring up a second node,
> that can't contact the first (the first being the seed for the second) after
> a short period of time, the second goes ahead and assumes it's the only node
> and bootstraps with all tokens.
> NOTE also this email from Robert Coli
> To: [email protected]
> Obviously if you have defined a seed and cannot contact it, the node should
> not start as a cluster of one. I have a to-do list item to file a JIRA on the
> subject, but if you wanted to file and link us, that'd be super. :)
> Startup trace (from the can't contact the seed messages below).
> http://aep.appspot.com/display/ABcWltCES1srzPrj5CkS69-GB8o/
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira