Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ED1F81063E for ; Wed, 20 Nov 2013 00:07:20 +0000 (UTC) Received: (qmail 57625 invoked by uid 500); 20 Nov 2013 00:07:20 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 57602 invoked by uid 500); 20 Nov 2013 00:07:20 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 57593 invoked by uid 99); 20 Nov 2013 00:07:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Nov 2013 00:07:20 +0000 Date: Wed, 20 Nov 2013 00:07:20 +0000 (UTC) From: "Jonathan Ellis (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-4375) FD incorrectly using RPC timeout to ignore gossip heartbeats MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-4375?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jonathan Ellis updated CASSANDRA-4375: -------------------------------------- Reviewer: Jonathan Ellis Fix Version/s: 2.0.3 1.2.12 Assignee: Brandon Williams Labels: gossip (was: ) bq. the RPC timeout to ignore unreasonably long intervals is not correct I agree; the two are unrelated. Suggest either hardcoding it to 10s or making it configurable. > FD incorrectly using RPC timeout to ignore gossip heartbeats > ------------------------------------------------------------ > > Key: CASSANDRA-4375 > URL: https://issues.apache.org/jira/browse/CASSANDRA-4375 > Project: Cassandra > Issue Type: Bug > Components: Core > Reporter: Peter Schuller > Assignee: Brandon Williams > Labels: gossip > Fix For: 1.2.12, 2.0.3 > > > Short version: You can't run a cluster with short RPC timeouts because nodes just constantly flap up/down. > Long version: > CASSANDRA-3273 tried to fix a problem resulting from the way the failure detector works, but did so by introducing a much more sever bug: With low RPC timeouts, that are lower than the typical gossip propagation time, a cluster will just constantly have all nodes flapping other nodes up and down. > The cause is this: > {code} > + // in the event of a long partition, never record an interval longer than the rpc timeout, > + // since if a host is regularly experiencing connectivity problems lasting this long we'd > + // rather mark it down quickly instead of adapting > + private final double MAX_INTERVAL_IN_MS = DatabaseDescriptor.getRpcTimeout(); > {code} > And then: > {code} > - tLast_ = value; > - arrivalIntervals_.add(interArrivalTime); > + if (interArrivalTime <= MAX_INTERVAL_IN_MS) > + arrivalIntervals_.add(interArrivalTime); > + else > + logger_.debug("Ignoring interval time of {}", interArrivalTime); > {code} > Using the RPC timeout to ignore unreasonably long intervals is not correct, as the RPC timeout is completely orthogonal to gossip propagation delay (see CASSANDRA-3927 for a quick description of how the FD works). > In practice, the propagation delay ends up being in the 0-3 second range on a cluster with good local latency. With a low RPC timeout of say 200 ms, very few heartbeat updates come in fast enough that it doesn't get ignored by the failure detector. This in turn means that the FD records a completely skewed average heartbeat interval, which in turn means that nodes almost always get flapped on interpret() unless they happen to *just* have had their heartbeat updated. Then they flap back up whenever the next heartbeat comes in (since it gets brought up immediately). > In our build, we are replacing the FD with an implementation that simply uses a fixed {{N}} second time to convict, because this is just one of many ways in which the current FD hurts, while we still haven't found a way it actually helps relative to the trivial fixed-second conviction policy. > For upstream, assuming people won't agree on changing it to a fixed timeout, I suggest, at minimum, never using a value lower than something like 10 seconds or something, when determining whether to ignore. Slightly better is to make it a config option. > (I should note that if propagation delays are significantly off from the expected level, other things than the FD already breaks - such as the whole concept of {{RING_DELAY}}, which assumes the propagation time is roughly constant with e.g. cluster size.) -- This message was sent by Atlassian JIRA (v6.1#6144)