Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 20BD9200B64 for ; Tue, 2 Aug 2016 21:21:39 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1F4B6160A76; Tue, 2 Aug 2016 19:21:39 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8C08B160A65 for ; Tue, 2 Aug 2016 21:21:37 +0200 (CEST) Received: (qmail 50773 invoked by uid 500); 2 Aug 2016 19:21:36 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 50761 invoked by uid 99); 2 Aug 2016 19:21:36 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Aug 2016 19:21:36 +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 8C5B9C21F4 for ; Tue, 2 Aug 2016 19:21:35 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.18 X-Spam-Level: * X-Spam-Status: No, score=1.18 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, WEIRD_PORT=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Dl5SF23cLMOn for ; Tue, 2 Aug 2016 19:21:32 +0000 (UTC) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id 5BB455F487 for ; Tue, 2 Aug 2016 19:21:31 +0000 (UTC) Received: by mail-lf0-f47.google.com with SMTP id f93so145647175lfi.2 for ; Tue, 02 Aug 2016 12:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=iKBCSmPqDcU7yow2/1KFYlbei+p7a4+oN8YGnFdJ3gI=; b=lMLpTTM7wQW8fsXYXt8pNvuUTseuY0ExQNZc97xBj0EkPvrKGV/MMCId/oFWaRNWKb u9AmT9YDdFKhUwQai7wW6+iYOpWMzqWf/r7sRa2oAXr4iHr3JI6gZF6D9y3XAXU5tYdZ i3st6xKST9j3p8OP/U+qau7f9q2kKQ7weXv5xr0Pmv24FMsCj6xctUCZQVt8axKePBy7 EHENGfdzk3gs76N3AzKDCG0pkT2Xr/1Ysa++1RIaWly8JzDojDtXFYw4XUbYH7+eUIga 6M94gcLsuEuGEMKaizlG5OmX60mYQDCcYduCsO99rNmALPFoqcd/CgVTyWtvZnkVbxwA SxXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=iKBCSmPqDcU7yow2/1KFYlbei+p7a4+oN8YGnFdJ3gI=; b=PqQZh6unHa5ShXfIhd8cFjHHf+Ue5/9FkzXMBJa2NaEnf6eiLTBcAnbThKRw6LOPaN AOLHIIrhSt5sx5tXnLxwh4zcuAFUStfwmwNw2Dm8Dmh3WeNXfPv0K6UTlLw93tFb7vqu kWGhwWVwh3JXSpdaIFmedqTIsGxLv+8eHQKuJqcPfisN+2DuLOBe7RTAw3zlFFa2UHBk XcVvgG69ti3KQ4SkfyopdEfBUn1vZJcRGHQO45ghfAJvaCwcE8/WhIu/6iWyJB5y9sOA UqHAfjtWEhW1h6qx1rBVcHYWCycQLwllAYOxQFLqx1Tjlw6SM5uEeA8ry/qsQa5eM3Nu iJnQ== X-Gm-Message-State: AEkoousMnlwhNA507Fe80I9Zs3LgzwhemOAUgv1lJqwJfN4c3SnHES+G1mMVE74o2kaPO6ShckBkuBQpOuBvxA== X-Received: by 10.46.9.141 with SMTP id 135mr19089819ljj.5.1470165689208; Tue, 02 Aug 2016 12:21:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.78.206 with HTTP; Tue, 2 Aug 2016 12:21:27 -0700 (PDT) In-Reply-To: References: <60C9117D-F2E3-4235-9F56-CC8AFC51B98B@apache.org> <24341E4C-8FDF-4DF6-A505-68DB546E1125@apache.org> From: Benjamin Jaton Date: Tue, 2 Aug 2016 12:21:27 -0700 Message-ID: Subject: Re: ZK read-only issue To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary=001a114b0aa2aa93a505391b9fcf archived-at: Tue, 02 Aug 2016 19:21:39 -0000 --001a114b0aa2aa93a505391b9fcf Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Yes, you can, I'll look at it. On Tue, Aug 2, 2016 at 11:40 AM, Flavio Junqueira wrote: > Thanks for putting it together, Ben. Do you mind if I create a jira, > upload this file there, and assign it to you? > > -Flavio > > > On 02 Aug 2016, at 19:32, Benjamin Jaton > wrote: > > > > What about a simple client like this? (see attached) > > > > On Sat, Jul 30, 2016 at 2:29 AM, Flavio Junqueira > wrote: > > We don't seem to have proper documentation for a case like this with > read-only, perhaps you'd be willing to write something down so that we ca= n > include in our documentation, Benjamin? > > > > We should in any case update the documentation with session states that > aren't reflected there, for example, SaslConnected is also not reflected. > > > > -Flavio > > > > > On 29 Jul 2016, at 22:52, Benjamin Jaton > wrote: > > > > > > I was not using for the watcher to give me a ConnectedReadOnly event = to > > > start using the ZooKeeper client, my bad. > > > When I use it it never fails. > > > > > > Thanks you for your time, sorry for my mixup. > > > Ben > > > > > > On Fri, Jul 29, 2016 at 2:29 PM, Camille Fournier > > > > wrote: > > > > > >> Just to clarify one thing though in the server logs from the fresh > install > > >> is the new read only server reporting anything? > > >> > > >> On Jul 29, 2016 5:26 PM, "Camille Fournier" > wrote: > > >> > > >>> Sorry again I'm having reading issues ignore that comment as I see > flavio > > >>> already answered it > > >>> > > >>> On Jul 29, 2016 5:25 PM, "Camille Fournier" > wrote: > > >>> > > >>>> Update, I was confused by races of my own doing. Was this client > > >>>> previously connected when it failed the read only check? The serve= r > log > > >> is > > >>>> rejecting it because the client is ahead in zxid in the first set = of > > >> logs. > > >>>> The other two servers are totally down and it's a new client when > you > > >> see > > >>>> this issue? > > >>>> > > >>>> On Jul 29, 2016 3:07 PM, "Camille Fournier" > wrote: > > >>>> > > >>>>> Ok yeah I think this is reproducible and a bug in the client > connection > > >>>>> read-only logic. > > >>>>> > > >>>>> On Fri, Jul 29, 2016 at 2:43 PM, Camille Fournier < > camille@apache.org > > > >>>>> wrote: > > >>>>> > > >>>>>> I'm looking at the readonly mode code right now and it appears > that > > >> the > > >>>>>> only way to set readonly mode is a global system property which > means > > >> that > > >>>>>> the tests for this are only testing across 3 servers, all of whi= ch > > >> have > > >>>>>> readonly mode set. So, this MAY be a bug, but what a pain to > figure > > >> out how > > >>>>>> to reproduce. > > >>>>>> > > >>>>>> Global system properties: not even once. > > >>>>>> > > >>>>>> On Fri, Jul 29, 2016 at 12:27 PM, Flavio Junqueira < > fpj@apache.org > > > >>>>>> wrote: > > >>>>>> > > >>>>>>> Not that I'm aware of... > > >>>>>>> > > >>>>>>> -Flavio > > >>>>>>> > > >>>>>>>> On 29 Jul 2016, at 17:24, Benjamin Jaton < > benjamin.jaton@gmail.com > > >>> > > >>>>>>> wrote: > > >>>>>>>> > > >>>>>>>> Hi Flavio, > > >>>>>>>> > > >>>>>>>> The bug / patch is only for the C client, does this issue affe= ct > > >> the > > >>>>>>> java > > >>>>>>>> client as well? > > >>>>>>>> > > >>>>>>>> On Thu, Jul 28, 2016 at 5:01 PM, Benjamin Jaton < > > >>>>>>> benjamin.jaton@gmail.com > > > >>>>>>>> wrote: > > >>>>>>>> > > >>>>>>>>> I will definitely try and I'll post an update, thanks again > > >> Flavio. > > >>>>>>>>> > > >>>>>>>>> On Thu, Jul 28, 2016 at 4:59 PM, Flavio Junqueira < > fpj@apache.org > > >>> > > >>>>>>> wrote: > > >>>>>>>>> > > >>>>>>>>>> I think you're hitting this: > > >>>>>>>>>> > > >>>>>>>>>> https://issues.apache.org/jira/browse/ZOOKEEPER-2466 < > https://issues.apache.org/jira/browse/ZOOKEEPER-2466> < > > >>>>>>>>>> https://issues.apache.org/jira/browse/ZOOKEEPER-2466 < > https://issues.apache.org/jira/browse/ZOOKEEPER-2466>> > > >>>>>>>>>> > > >>>>>>>>>> which is resolved for 3.5.3 and trunk. You can try out the > patch. > > >>>>>>>>>> > > >>>>>>>>>> -Flavio > > >>>>>>>>>> > > >>>>>>>>>>> On 29 Jul 2016, at 00:56, Benjamin Jaton < > > >>>>>>> benjamin.jaton@gmail.com > > > >>>>>>>>>> wrote: > > >>>>>>>>>>> > > >>>>>>>>>>> OK so I did another fresh install this time using > 3.5.2-alpha, > > >>>>>>> and the > > >>>>>>>>>> read > > >>>>>>>>>>> only client doesn't seem to try all the hosts available. > > >>>>>>>>>>> > > >>>>>>>>>>> I create my client with: > > >>>>>>>>>>> ZooKeeper zk =3D new ZooKeeper("10.11.9.70:2181 < > http://10.11.9.70:2181/>,10.11.12.4:2181 , > > >>>>>>>>>>> 10.11.12.210:2181 ", 45000, > this, true); > > >>>>>>>>>>> > > >>>>>>>>>>> In the following output, it only checks for 10.11.12.4:2181 > and > > >>>>>>>>>>> 10.11.12.210:2181 , but it > doesn't try 10.11.9.70:2181 which is > > >>>>>>> where > > >>>>>>>>>> the > > >>>>>>>>>>> running server is. > > >>>>>>>>>>> > > >>>>>>>>>>> 0 [main] INFO org.apache.zookeeper.ZooKeeper - Client > > >>>>>>>>>>> environment:zookeeper.version=3D3.5.2-alpha-1753710, built = on > > >>>>>>> 07/21/2016 > > >>>>>>>>>>> 16:24 GMT > > >>>>>>>>>>> 1 [main] INFO org.apache.zookeeper.ZooKeeper - Client > > >>>>>>> environment: > > >>>>>>>>>> host.name > > >>>>>>>>>>> =3Dw-rli09-ben > > >>>>>>>>>>> 1 [main] INFO org.apache.zookeeper.ZooKeeper - Client > > >>>>>>>>>>> environment:java.version=3D1.8.0_11 > > >>>>>>>>>>> 1 [main] INFO org.apache.zookeeper.ZooKeeper - Client > > >>>>>>>>>>> environment:java.vendor=3DOracle Corporation > > >>>>>>>>>>> 1 [main] INFO org.apache.zookeeper.ZooKeeper - Client > > >>>>>>>>>>> environment:java.home=3D/usr/local/apps/jdk1.8.0_11/jre > > >>>>>>>>>>> 1 [main] INFO org.apache.zookeeper.ZooKeeper - Client > > >>>>>>>>>>> > > >>>>>>>>>> > > >>>>>>> > > >> > environment:java.class.path=3D/home/benji/workspace-trunk/testzkclient/bi= n:/home/benji/workspace-trunk/zookeeper-3.5.2/build/lib/commons-cli-1.2.jar= :/home/benji/workspace-trunk/zookeeper-3.5.2/build/lib/jackson-core-asl-1.9= .11.jar:/home/benji/workspace-trunk/zookeeper-3.5.2/build/lib/jackson-mappe= r-asl-1.9.11.jar:/home/benji/workspace-trunk/zookeeper-3.5.2/build/lib/java= cc.jar:/home/benji/workspace-trunk/zookeeper-3.5.2/build/lib/jetty-6.1.26.j= ar:/home/benji/workspace-trunk/zookeeper-3.5.2/build/lib/jetty-util-6.1.26.= jar:/home/benji/workspace-trunk/zookeeper-3.5.2/build/lib/jline-2.11.jar:/h= ome/benji/workspace-trunk/zookeeper-3.5.2/build/lib/log4j-1.2.17.jar:/home/= benji/workspace-trunk/zookeeper-3.5.2/build/lib/netty-3.10.5.Final.jar:/hom= e/benji/workspace-trunk/zookeeper-3.5.2/build/lib/servlet-api-2.5-20081211.= jar:/home/benji/workspace-trunk/zookeeper-3.5.2/build/lib/slf4j-api-1.7.5.j= ar:/home/benji/workspace-trunk/zookeeper-3.5.2/build/lib/slf4j-log4j12-1.7.= 5.jar:/home/benji/workspace-trunk/zookeeper-3.5.2/build/zookeeper-3.5.2-alp= ha.jar > > >>>>>>>>>>> 2 [main] INFO org.apache.zookeeper.ZooKeeper - Client > > >>>>>>>>>>> > > >>>>>>>>>> > > >>>>>>> > > >> > environment:java.library.path=3D/usr/java/packages/lib/amd64:/usr/lib64:/= lib64:/lib:/usr/lib > > >>>>>>>>>>> 2 [main] INFO org.apache.zookeeper.ZooKeeper - Client > > >>>>>>>>>>> environment:java.io.tmpdir=3D/tmp > > >>>>>>>>>>> 2 [main] INFO org.apache.zookeeper.ZooKeeper - Client > > >>>>>>>>>>> environment:java.compiler=3D > > >>>>>>>>>>> 2 [main] INFO org.apache.zookeeper.ZooKeeper - Client > > >>>>>>> environment: > > >>>>>>>>>> os.name > > >>>>>>>>>>> =3DLinux > > >>>>>>>>>>> 2 [main] INFO org.apache.zookeeper.ZooKeeper - Client > > >>>>>>>>>>> environment:os.arch=3Damd64 > > >>>>>>>>>>> 2 [main] INFO org.apache.zookeeper.ZooKeeper - Client > > >>>>>>>>>>> environment:os.version=3D3.8.0-44-generic > > >>>>>>>>>>> 2 [main] INFO org.apache.zookeeper.ZooKeeper - Client > > >>>>>>> environment: > > >>>>>>>>>> user.name > > >>>>>>>>>>> =3Dbenji > > >>>>>>>>>>> 2 [main] INFO org.apache.zookeeper.ZooKeeper - Client > > >>>>>>>>>>> environment:user.home=3D/home/benji > > >>>>>>>>>>> 2 [main] INFO org.apache.zookeeper.ZooKeeper - Client > > >>>>>>>>>>> environment:user.dir=3D/home/benji/workspace-trunk/testzkcl= ient > > >>>>>>>>>>> 2 [main] INFO org.apache.zookeeper.ZooKeeper - Client > > >>>>>>>>>>> environment:os.memory.free=3D376MB > > >>>>>>>>>>> 2 [main] INFO org.apache.zookeeper.ZooKeeper - Client > > >>>>>>>>>>> environment:os.memory.max=3D5358MB > > >>>>>>>>>>> 2 [main] INFO org.apache.zookeeper.ZooKeeper - Client > > >>>>>>>>>>> environment:os.memory.total=3D378MB > > >>>>>>>>>>> *8 [main] INFO org.apache.zookeeper.ZooKeeper - Initiating > > >> client > > >>>>>>>>>>> connection, connectString=3D10.11.9.70:2181 < > http://10.11.9.70:2181/> > > >>>>>>>>>>> >, > 10.11.12.4:2181 > > >>>>>>>>>>> >, > 10.11.12.210:2181 < > > >>>>>>> http://10.11.12.210:2181 > > > >>>>>>>>>>> sessionTimeout=3D45000 > > >>>>>>> watcher=3Dtestzkclient.TestZkReadOnlyClient@5010be6* > > >>>>>>>>>>> 21 [main] DEBUG org.apache.zookeeper.ClientCnxnSocket - > > >>>>>>> jute.maxbuffer > > >>>>>>>>>> is > > >>>>>>>>>>> 4194304 > > >>>>>>>>>>> Successfully established the connection with ZooKeeper > > >>>>>>>>>>> *37 [main-SendThread(10.11.12.4:2181 < > http://10.11.12.4:2181/> >>)] > > >>>>>>> INFO > > >>>>>>>>>>> org.apache.zookeeper.ClientCnxn - Opening socket connectio= n > to > > >>>>>>> server > > >>>>>>>>>>> 10.11.12.4/10.11.12.4:2181 < > http://10.11.12.4/10.11.12.4:2181> http://10.11.12.4/10.11.12.4:2181>>. > > >>>>>>> Will > > >>>>>>>>>> not > > >>>>>>>>>>> attempt to authenticate using SASL (unknown error)* > > >>>>>>>>>>> 43 [main-SendThread(10.11.12.4:2181 )] > WARN > > >>>>>>>>>> org.apache.zookeeper.ClientCnxn > > >>>>>>>>>>> - Session 0x0 for server null, unexpected error, closing > socket > > >>>>>>>>>> connection > > >>>>>>>>>>> and attempting reconnect > > >>>>>>>>>>> java.net.ConnectException: Connection refused > > >>>>>>>>>>> at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method= ) > > >>>>>>>>>>> at > > >>>>>>>>>>> > > >>>>>>> > > >> sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:71= 2) > > >>>>>>>>>>> at > > >>>>>>>>>>> > > >>>>>>>>>> > > >>>>>>> > > >> > org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.= java:357) > > >>>>>>>>>>> at > > >>>>>>>>>> > > >>>>>>> > org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1214) > > >>>>>>>>>>> 45 [main-SendThread(10.11.12.4:2181 )] > DEBUG > > >>>>>>>>>>> org.apache.zookeeper.ClientCnxnSocketNIO - Ignoring > exception > > >>>>>>> during > > >>>>>>>>>>> shutdown input > > >>>>>>>>>>> java.nio.channels.ClosedChannelException > > >>>>>>>>>>> at > > >>>>>>>>>>> > > >>>>>>> > > >> sun.nio.ch.SocketChannelImpl.shutdownInput(SocketChannelImpl.java:77= 5) > > >>>>>>>>>>> at > > >>>>>>> sun.nio.ch.SocketAdaptor.shutdownInput(SocketAdaptor.java:402) > > >>>>>>>>>>> at > > >>>>>>>>>>> > > >>>>>>>>>> > > >>>>>>> > > >> > org.apache.zookeeper.ClientCnxnSocketNIO.cleanup(ClientCnxnSocketNIO.java= :198) > > >>>>>>>>>>> at > > >>>>>>>>>>> > > >>>>>>> > > >> > org.apache.zookeeper.ClientCnxn$SendThread.cleanup(ClientCnxn.java:1325) > > >>>>>>>>>>> at > > >>>>>>>>>> > > >>>>>>> > org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1245) > > >>>>>>>>>>> 45 [main-SendThread(10.11.12.4:2181 )] > DEBUG > > >>>>>>>>>>> org.apache.zookeeper.ClientCnxnSocketNIO - Ignoring > exception > > >>>>>>> during > > >>>>>>>>>>> shutdown output > > >>>>>>>>>>> java.nio.channels.ClosedChannelException > > >>>>>>>>>>> at > > >>>>>>>>>>> > > >>>>>>> > > >> > sun.nio.ch.SocketChannelImpl.shutdownOutput(SocketChannelImpl.java:792) > > >>>>>>>>>>> at > > >>>>>>> sun.nio.ch.SocketAdaptor.shutdownOutput(SocketAdaptor.java:410) > > >>>>>>>>>>> at > > >>>>>>>>>>> > > >>>>>>>>>> > > >>>>>>> > > >> > org.apache.zookeeper.ClientCnxnSocketNIO.cleanup(ClientCnxnSocketNIO.java= :205) > > >>>>>>>>>>> at > > >>>>>>>>>>> > > >>>>>>> > > >> > org.apache.zookeeper.ClientCnxn$SendThread.cleanup(ClientCnxn.java:1325) > > >>>>>>>>>>> at > > >>>>>>>>>> > > >>>>>>> > org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1245) > > >>>>>>>>>>> *149 [main-SendThread(10.11.12.210:2181 < > http://10.11.12.210:2181/> < > > >> http://10.11.12.210:2181 > > >>>>>>>> )] > > >>>>>>>>>> INFO > > >>>>>>>>>>> org.apache.zookeeper.ClientCnxn - Opening socket connectio= n > to > > >>>>>>> server > > >>>>>>>>>>> 10.11.12.210/10.11.12.210:2181 < > http://10.11.12.210/10.11.12.210:2181> < > > >>>>>>> http://10.11.12.210/10.11.12.210:2181 < > http://10.11.12.210/10.11.12.210:2181>>. > > >>>>>>>>>>> Will not attempt to authenticate using SASL (unknown error)= * > > >>>>>>>>>>> 150 [main-SendThread(10.11.12.210:2181 < > http://10.11.12.210:2181/>)] WARN > > >>>>>>>>>>> org.apache.zookeeper.ClientCnxn - Session 0x0 for server > null, > > >>>>>>>>>> unexpected > > >>>>>>>>>>> error, closing socket connection and attempting reconnect > > >>>>>>>>>>> java.net.ConnectException: Connection refused > > >>>>>>>>>>> at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method= ) > > >>>>>>>>>>> at > > >>>>>>>>>>> > > >>>>>>> > > >> sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:71= 2) > > >>>>>>>>>>> at > > >>>>>>>>>>> > > >>>>>>>>>> > > >>>>>>> > > >> > org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.= java:357) > > >>>>>>>>>>> at > > >>>>>>>>>> > > >>>>>>> > org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1214) > > >>>>>>>>>>> 150 [main-SendThread(10.11.12.210:2181 < > http://10.11.12.210:2181/>)] DEBUG > > >>>>>>>>>>> org.apache.zookeeper.ClientCnxnSocketNIO - Ignoring > exception > > >>>>>>> during > > >>>>>>>>>>> shutdown input > > >>>>>>>>>>> java.nio.channels.ClosedChannelException > > >>>>>>>>>>> at > > >>>>>>>>>>> > > >>>>>>> > > >> sun.nio.ch.SocketChannelImpl.shutdownInput(SocketChannelImpl.java:77= 5) > > >>>>>>>>>>> at > > >>>>>>> sun.nio.ch.SocketAdaptor.shutdownInput(SocketAdaptor.java:402) > > >>>>>>>>>>> at > > >>>>>>>>>>> > > >>>>>>>>>> > > >>>>>>> > > >> > org.apache.zookeeper.ClientCnxnSocketNIO.cleanup(ClientCnxnSocketNIO.java= :198) > > >>>>>>>>>>> at > > >>>>>>>>>>> > > >>>>>>> > > >> > org.apache.zookeeper.ClientCnxn$SendThread.cleanup(ClientCnxn.java:1325) > > >>>>>>>>>>> at > > >>>>>>>>>> > > >>>>>>> > org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1245) > > >>>>>>>>>>> 150 [main-SendThread(10.11.12.210:2181 < > http://10.11.12.210:2181/>)] DEBUG > > >>>>>>>>>>> org.apache.zookeeper.ClientCnxnSocketNIO - Ignoring > exception > > >>>>>>> during > > >>>>>>>>>>> shutdown output > > >>>>>>>>>>> java.nio.channels.ClosedChannelException > > >>>>>>>>>>> at > > >>>>>>>>>>> > > >>>>>>> > > >> > sun.nio.ch.SocketChannelImpl.shutdownOutput(SocketChannelImpl.java:792) > > >>>>>>>>>>> at > > >>>>>>> sun.nio.ch.SocketAdaptor.shutdownOutput(SocketAdaptor.java:410) > > >>>>>>>>>>> at > > >>>>>>>>>>> > > >>>>>>>>>> > > >>>>>>> > > >> > org.apache.zookeeper.ClientCnxnSocketNIO.cleanup(ClientCnxnSocketNIO.java= :205) > > >>>>>>>>>>> at > > >>>>>>>>>>> > > >>>>>>> > > >> > org.apache.zookeeper.ClientCnxn$SendThread.cleanup(ClientCnxn.java:1325) > > >>>>>>>>>>> at > > >>>>>>>>>> > > >>>>>>> > org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1245) > > >>>>>>>>>>> *Exception in thread "main" > > >>>>>>>>>>> org.apache.zookeeper.KeeperException$ConnectionLossExceptio= n: > > >>>>>>>>>>> KeeperErrorCode =3D ConnectionLoss for /* > > >>>>>>>>>>> at > > >>>>>>>>>> > > >>>>>>> > org.apache.zookeeper.KeeperException.create(KeeperException.java:99) > > >>>>>>>>>>> at > > >>>>>>>>>> > > >>>>>>> > org.apache.zookeeper.KeeperException.create(KeeperException.java:51) > > >>>>>>>>>>> at > org.apache.zookeeper.ZooKeeper.getData(ZooKeeper.java:1956) > > >>>>>>>>>>> at > org.apache.zookeeper.ZooKeeper.getData(ZooKeeper.java:1985) > > >>>>>>>>>>> at > > >>>>>>>>>> > > >> testzkclient.TestZkReadOnlyClient.run(TestZkReadOnlyClient.java:26) > > >>>>>>>>>>> at > > >>>>>>>>>> > > >>>>>>> > testzkclient.TestZkReadOnlyClient.main(TestZkReadOnlyClient.java:13) > > >>>>>>>>>>> > > >>>>>>>>>>> > > >>>>>>>>>>> Does anybody else have issues with the readonly mode? > > >>>>>>>>>>> > > >>>>>>>>>>> Thanks > > >>>>>>>>>>> Benjamin > > >>>>>>>>>>> > > >>>>>>>>>>> > > >>>>>>>>>>> On Sat, Jul 16, 2016 at 7:39 PM, Benjamin Jaton < > > >>>>>>>>>> benjamin.jaton@gmail.com > > > >>>>>>>>>>> wrote: > > >>>>>>>>>>> > > >>>>>>>>>>>> Very interesting, thank you Flavio. > > >>>>>>>>>>>> > > >>>>>>>>>>>> That should not happen because I have actually never start= ed > > >>>>>>> (even > > >>>>>>>>>> never > > >>>>>>>>>>>> created) the other servers. This server is the first one t= he > > >>>>>>> client > > >>>>>>>>>> could > > >>>>>>>>>>>> have possibly ever seen. Maybe the server has to have been > in a > > >>>>>>>>>> functioning > > >>>>>>>>>>>> ensemble at least once before being able to be read only > able? > > >>>>>>>>>>>> I will recheck all my setup and do it again. > > >>>>>>>>>>>> Thanks again, > > >>>>>>>>>>>> Ben > > >>>>>>>>>>>> > > >>>>>>>>>>>> On Wed, Jul 13, 2016 at 2:06 PM, Flavio Junqueira < > > >>>>>>> fpj@apache.org > > > >>>>>>>>>> wrote: > > >>>>>>>>>>>> > > >>>>>>>>>>>>> From the logs, it looks like the server the client is > trying > > >> to > > >>>>>>>>>> connect > > >>>>>>>>>>>>> to is behind compared to last zxid the client has seen: > > >>>>>>>>>>>>> > > >>>>>>>>>>>>> Refusing session request for client /10.11.12.4:4923= 7 > > > >> as > > >>>>>>> it > > >>>>>>>>>> has > > >>>>>>>>>>>>> seen zxid 0x3 our last zxid is 0x0 client must try anothe= r > > >>>>>>> server > > >>>>>>>>>>>>> > > >>>>>>>>>>>>> I believe the behavior we currently have is that a client > can > > >>>>>>> connect > > >>>>>>>>>> to > > >>>>>>>>>>>>> an RO server, but the server must have a view at least as > > >>>>>>> recent as > > >>>>>>>>>> the > > >>>>>>>>>>>>> server. > > >>>>>>>>>>>>> > > >>>>>>>>>>>>> -Flavio > > >>>>>>>>>>>>> > > >>>>>>>>>>>>>> On 12 Jul 2016, at 16:23, Benjamin Jaton < > > >>>>>>> benjamin.jaton@gmail.com > > > >>>>>>>>>>>>> wrote: > > >>>>>>>>>>>>>> > > >>>>>>>>>>>>>> Hello, > > >>>>>>>>>>>>>> > > >>>>>>>>>>>>>> I'm having problems using ZK in read-only mode. > > >>>>>>>>>>>>>> I am using a fresh install of ZK 3.5.1-alpha where I > > >> configure > > >>>>>>> the > > >>>>>>>>>>>>> installation to be in a 3 nodes ensemble. > > >>>>>>>>>>>>>> I start this node only (QA-E8WIN11) with > > >>>>>>> -Dreadonlymode.enabled=3Dtrue. > > >>>>>>>>>>>>>> > > >>>>>>>>>>>>>> I see that the node QA-E8WIN11 starts the RO server > properly: > > >>>>>>>>>>>>>> 2016-07-12 16:10:10,955 [myid:1] - INFO > > >>>>>>>>>>>>> [Thread-4:ReadOnlyZooKeeperServer@73] - Read-only server > > >>>>>>> started > > >>>>>>>>>>>>>> > > >>>>>>>>>>>>>> Then I make a read-only enabled client: > > >>>>>>>>>>>>>> > > >>>>>>>>>>>>>> ZooKeeper zk =3D new > > >>>>>>>>>>>>> > ZooKeeper("QA-E8WIN12:2181,QA-E8WIN13:2181,QA-E8WIN11:2181", > > >>>>>>> 45000, > > >>>>>>>>>> this, > > >>>>>>>>>>>>> true); > > >>>>>>>>>>>>>> System.out.println("Successfully established the > > >>>>>>> connection > > >>>>>>>>>>>>> with ZooKeeper"); > > >>>>>>>>>>>>>> > > >>>>>>>>>>>>>> zk.getData("/", false, null); > > >>>>>>>>>>>>>> System.out.println("Done."); > > >>>>>>>>>>>>>> > > >>>>>>>>>>>>>> Note that only QA-E8WIN11 is started, the other 2 are no= t. > > >>>>>>>>>>>>>> > > >>>>>>>>>>>>>> When the ZK client picks QA-E8WIN11 first, it works. > > >>>>>>>>>>>>>> But when it picks a different node, it fails with: > > >>>>>>>>>>>>>> > > >>>>>>>>>>>>>> 16:10:13.338 org.apache.zookeeper.ZooKeeper:716 - > Initiating > > >>>>>>> client > > >>>>>>>>>>>>> connection, > > >>>>>>>>>> connectString=3DQA-E8WIN12:2181,QA-E8WIN13:2181,QA-E8WIN11:2= 181 > > >>>>>>>>>>>>> sessionTimeout=3D45000 watcher=3DTestZkReadOnly@68de145 > > >>>>>>>>>>>>>> Successfully established the connection with ZooKeeper > > >>>>>>>>>>>>>> 16:10:13.475 org.apache.zookeeper.ClientCnxn:1138 - > Opening > > >>>>>>> socket > > >>>>>>>>>>>>> connection to server QA-E8WIN13/10.11.8.230:2181 < > http://10.11.8.230:2181/> < > > >>>>>>>>>>>>> http://10.11.8.230:2181/ >. > Will not attempt to authenticate > > >>>>>>> using > > >>>>>>>>>> SASL > > >>>>>>>>>>>>> (unknown error) > > >>>>>>>>>>>>>> 16:10:28.469 org.apache.zookeeper.ClientCnxn:1251 - Clie= nt > > >>>>>>> session > > >>>>>>>>>>>>> timed out, have not heard from server in 15001ms for > sessionid > > >>>>>>> 0x0, > > >>>>>>>>>> closing > > >>>>>>>>>>>>> socket connection and attempting reconnect > > >>>>>>>>>>>>>> 16:10:28.574 org.apache.zookeeper.ClientCnxn:1138 - > Opening > > >>>>>>> socket > > >>>>>>>>>>>>> connection to server QA-E8WIN12/10.11.8.232:2181 < > http://10.11.8.232:2181/> < > > >>>>>>>>>>>>> http://10.11.8.232:2181/ >. > Will not attempt to authenticate > > >>>>>>> using > > >>>>>>>>>> SASL > > >>>>>>>>>>>>> (unknown error) > > >>>>>>>>>>>>>> Exception in thread "main" > > >>>>>>>>>>>>> > org.apache.zookeeper.KeeperException$ConnectionLossException: > > >>>>>>>>>>>>> KeeperErrorCode =3D ConnectionLoss for / > > >>>>>>>>>>>>>> at > > >>>>>>>>>>>>> > > >>>>>>> > org.apache.zookeeper.KeeperException.create(KeeperException.java:99) > > >>>>>>>>>>>>>> at > > >>>>>>>>>>>>> > > >>>>>>> > org.apache.zookeeper.KeeperException.create(KeeperException.java:51) > > >>>>>>>>>>>>>> at > > >>>>>>> org.apache.zookeeper.ZooKeeper.getData(ZooKeeper.java:1753) > > >>>>>>>>>>>>>> at > > >>>>>>> org.apache.zookeeper.ZooKeeper.getData(ZooKeeper.java:1782) > > >>>>>>>>>>>>>> at TestZkReadOnly.run(TestZkReadOnly.java:26) > > >>>>>>>>>>>>>> at TestZkReadOnly.main(TestZkReadOnly.java:16) > > >>>>>>>>>>>>>> > > >>>>>>>>>>>>>> I'm attaching all the logs. The server and the client ar= e > on > > >>>>>>> the same > > >>>>>>>>>>>>> machine QA-E8WIN11. > > >>>>>>>>>>>>>> > > >>>>>>>>>>>>>> Any help would be greatly appreciated! > > >>>>>>>>>>>>>> > > >>>>>>>>>>>>>> Thanks, > > >>>>>>>>>>>>>> Benjamin Jaton > > >>>>>>>>>>>>>> > > >>>>>>>>>>>>> > > >>>>>>>>>>>>> > > >>>>>>>>>>>> > > >>>>>>>>>> > > >>>>>>>>>> > > >>>>>>>>> > > >>>>>>> > > >>>>>>> > > >>>>>> > > >>>>> > > >> > > > > > > > > --001a114b0aa2aa93a505391b9fcf--