Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 53B8F10036 for ; Sat, 24 Oct 2015 16:10:59 +0000 (UTC) Received: (qmail 86856 invoked by uid 500); 24 Oct 2015 16:10:56 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 86817 invoked by uid 500); 24 Oct 2015 16:10:56 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 86803 invoked by uid 99); 24 Oct 2015 16:10:56 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Oct 2015 16:10:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id D0707C533D for ; Sat, 24 Oct 2015 16:10:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.901 X-Spam-Level: ** X-Spam-Status: No, score=2.901 tagged_above=-999 required=6.31 tests=[AC_DIV_BONANZA=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id E-7RKX91LK9w for ; Sat, 24 Oct 2015 16:10:40 +0000 (UTC) Received: from mail-yk0-f176.google.com (mail-yk0-f176.google.com [209.85.160.176]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 7762028585 for ; Sat, 24 Oct 2015 16:10:34 +0000 (UTC) Received: by yknn9 with SMTP id n9so147772052ykn.0 for ; Sat, 24 Oct 2015 09:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=uM5hpkzqRtnx2k3mp5M3Ywt5atRvpY3fqR5D6jZXjM4=; b=kfhZSTD/bGkkujxJ7pFKgyLWi4b8wb+pfAjPqk8vZ/iQaKInLDO3zEVszOjqqkQcCN L06P19rxxep6A3z6F4NIjvu00vJDDJBruFMa1t52kRul9jGiR+I3HZG8SxeR4dEY64+0 jgmLrfzxnmlF8E60sdy7vXgFx8cxu1hqvQ9YtkTMuru2bOSgvtdEznR6GPaa9E2gQhCh nfMP186/+OzL2kzY9NaBeacJmpkedTLJNzul2S8bK+H9LQYKF4eFbxj3OJKY8ZCVye7F 5NxtWxCKgSPMDqGc/GtjAVLKO24ipWgpuVl/apm1YABP1uBx8Et28zBXG1zZkZGELS8a uiDQ== MIME-Version: 1.0 X-Received: by 10.129.49.144 with SMTP id x138mr12161414ywx.171.1445703027884; Sat, 24 Oct 2015 09:10:27 -0700 (PDT) Received: by 10.13.203.7 with HTTP; Sat, 24 Oct 2015 09:10:27 -0700 (PDT) In-Reply-To: References: <156AA069D74CB042AA529A69006652531D6460D7@CO1PRD6102MB001.025d.mgd.msft.net> <5629AB00.8070008@pbandjelly.org> Date: Sat, 24 Oct 2015 21:40:27 +0530 Message-ID: Subject: Re: Is replication possible with already existing data? From: Ajay Garg To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=001a1145c12c6d8efb0522dbf7c1 --001a1145c12c6d8efb0522dbf7c1 Content-Type: text/plain; charset=UTF-8 Ideas please, on what I may be doing wrong? On Sat, Oct 24, 2015 at 5:48 PM, Ajay Garg wrote: > Hi All. > > I have been doing extensive testing, and replication works fine, even if > any permuatation of CAS11, CAS12, CAS21, CAS22 are downed and brought up. > Syncing always takes place (obviously, as long as continuous-downtime-value > does not exceed *max_hint_window_in_ms*). > > > However, things behave weird when I try connecting via DataStax > Java-Driver. > I always add the nodes to the cluster in the order :: > > CAS11, CAS12, CAS21, CAS22 > > during "cluster.connect" method. > > > Now, following happens :: > > a) > If CAS11 goes down, data is persisted fine (presumably first in CAS12, and > later replicated to CAS21 and CAS22). > > b) > If CAS11 and CAS12 go down, data is NOT persisted. > Instead the following exceptions are observed in the Java-Driver :: > > > ################################################################################## > Exception in thread "main" > com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) > tried for query failed (no host was tried) > at > com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:65) > at > com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException(DefaultResultSetFuture.java:258) > at com.datastax.driver.core.Cluster.connect(Cluster.java:267) > at com.example.cassandra.SimpleClient.connect(SimpleClient.java:43) > at > com.example.cassandra.SimpleClientTest.setUp(SimpleClientTest.java:50) > at > com.example.cassandra.SimpleClientTest.main(SimpleClientTest.java:86) > Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: > All host(s) tried for query failed (no host was tried) > at > com.datastax.driver.core.RequestHandler.sendRequest(RequestHandler.java:103) > at > com.datastax.driver.core.SessionManager.execute(SessionManager.java:446) > at > com.datastax.driver.core.SessionManager.executeQuery(SessionManager.java:482) > at > com.datastax.driver.core.SessionManager.executeAsync(SessionManager.java:88) > at > com.datastax.driver.core.AbstractSession.executeAsync(AbstractSession.java:60) > at com.datastax.driver.core.Cluster.connect(Cluster.java:260) > ... 3 more > > ################################################################################### > > > I have already tried :: > > 1) > Increasing driver-read-timeout from 12 seconds to 30 seconds. > > 2) > Increasing driver-connect-timeout from 5 seconds to 30 seconds. > > 3) > I have also confirmed that each of the 4 nodes are telnet-able over ports > 9042 and 9160 each. > > > Definitely seems to be some driver-issue, since > data-persistence/replication works perfect (with any permutation) if > data-persistence is done via "cqlsh". > > > Kindly provide some pointers. > Ultimately, it is the Java-driver that will be used in production, so it > is imperative that data-persistence/replication happens for any downing of > any permutation of node(s). > > > Thanks and Regards, > Ajay > -- Regards, Ajay --001a1145c12c6d8efb0522dbf7c1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Ideas please, on what I may be doing wrong?

On Sat, Oct 24, 2015 a= t 5:48 PM, Ajay Garg <ajaygargnsit@gmail.com> wrote:
<= div>
Hi All.

<= /div>I have been doing extensive testing, and replication works fine, even = if any permuatation of CAS11, CAS12, CAS21, CAS22 are downed and brought up= . Syncing always takes place (obviously, as long as continuous-downtime-val= ue does not exceed max_hint_window_in_ms).


However,= things behave weird when I try connecting via DataStax Java-Driver.
I always add the nodes to the cluster in the order ::

=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CAS11, C= AS12, CAS21, CAS22

during "cluster.connect" met= hod.


Now, following happens ::

a)<= br>
If CAS11 goes down, data is persisted fine (presumably first in CA= S12, and later replicated to CAS21 and CAS22).

b)
If = CAS11 and CAS12 go down, data is NOT persisted.
Instead the follow= ing exceptions are observed in the Java-Driver ::

##################= ################################################################
Excepti= on in thread "main" com.datastax.driver.core.exceptions.NoHostAva= ilableException: All host(s) tried for query failed (no host was tried)
= =C2=A0=C2=A0=C2=A0 at com.datastax.driver.core.exceptions.NoHostAvailableEx= ception.copy(NoHostAvailableException.java:65)
=C2=A0=C2=A0=C2=A0 at com= .datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionExcep= tion(DefaultResultSetFuture.java:258)
=C2=A0=C2=A0=C2=A0 at com.datastax= .driver.core.Cluster.connect(Cluster.java:267)
=C2=A0=C2=A0=C2=A0 at com= .example.cassandra.SimpleClient.connect(SimpleClient.java:43)
=C2=A0=C2= =A0=C2=A0 at com.example.cassandra.SimpleClientTest.setUp(SimpleClientTest.= java:50)
=C2=A0=C2=A0=C2=A0 at com.example.cassandra.SimpleClientTest.ma= in(SimpleClientTest.java:86)
Caused by: com.datastax.driver.core.excepti= ons.NoHostAvailableException: All host(s) tried for query failed (no host w= as tried)
=C2=A0=C2=A0=C2=A0 at com.datastax.driver.core.RequestHandler.= sendRequest(RequestHandler.java:103)
=C2=A0=C2=A0=C2=A0 at com.datastax.= driver.core.SessionManager.execute(SessionManager.java:446)
=C2=A0=C2=A0= =C2=A0 at com.datastax.driver.core.SessionManager.executeQuery(SessionManag= er.java:482)
=C2=A0=C2=A0=C2=A0 at com.datastax.driver.core.SessionManag= er.executeAsync(SessionManager.java:88)
=C2=A0=C2=A0=C2=A0 at com.datast= ax.driver.core.AbstractSession.executeAsync(AbstractSession.java:60)
=C2= =A0=C2=A0=C2=A0 at com.datastax.driver.core.Cluster.connect(Cluster.java:26= 0)
=C2=A0=C2=A0=C2=A0 ... 3 more
####################################= ###############################################


I have alr= eady tried ::

1)
Increasing driver-read-timeout from 12 sec= onds to 30 seconds.

2)
Increasing driver-connect-timeout fr= om 5 seconds to 30 seconds.

3)
I have also confirmed that e= ach of the 4 nodes are telnet-able over ports 9042 and 9160 each.

Definitely seems to be some driver-issue, since data-persistence/re= plication works perfect (with any permutation) if data-persistence is done = via "cqlsh".


Kindly provide some pointers.
Ultimately, it is the Java-driver that will be used in production, so i= t is imperative that data-persistence/replication happens for any downing o= f any permutation of node(s).


Thanks and Regards,
Ajay



--
Regards,
Ajay
--001a1145c12c6d8efb0522dbf7c1--