Re: IllegalArgumentException excpetion : Path cannot be null

2010-08-30 Thread Patrick Hunt
The client (solr in this case) is passing a null path to the
ZooKeeper.getChildren(path, ... ) call.

java.lang.IllegalArgumentException: Path cannot be null
   at
org.apache.zookeeper.common.PathUtils.validatePath(PathUtils.java:45)
   at
org.apache.zookeeper.ZooKeeper.getChildren(zookeeper:ZooKeeper.java):1196)
   at
org.apache.solr.common.cloud.SolrZkClient.getChildren(SolrZkClient.java:200)

I'm afraid you'll have to work with the solr team to determine the cause of
this.

Patrick

On Thu, Aug 26, 2010 at 12:15 AM, Yatir Ben Shlomo yat...@outbrain.comwrote:

 I am running a zookeeper ensemble of 3 zookeeper instances
 and established a solrCloud to work with it (2 masters , 2 slaves)
 on one of the masters I keep noticing ZooKeeper related exceptions which I
 can't understand:
 And the other is java.lang.IllegalArgumentException: Path cannot be null
 (PathUtils.java:45)

 Here are my logs (I set the log level to FINE on zookeeper package)

  Anyone can identify the issue?
 (I could not yet get any help from the solrCloud community)


 FINE: Reading reply sessionid:0x12a97312613010b, packet:: clientPath:null
 serverPath:null finished:false header:: -8,101  replyHeader:: -8,-1,0
  request::
 30064776552,v{'/collections},v{},v{'/collections/ENPwl/shards/ENPWL1,'/collections/ENPwl/shards/ENPWL4,'/collections/ENPwl/shards/ENPWL2,'/collections,'/collections/ENPwl/shards/ENPWL3,'/collections/ENPwlMaster/shards/ENPWLMaster_3,'/collections/ENPwlMaster/shards/ENPWLMaster_4,'/live_nodes,'/collections/ENPwlMaster/shards/ENPWLMaster_1,'/collections/ENPwlMaster/shards/ENPWLMaster_2}
  response:: null
 Aug 25, 2010 5:18:19 AM org.apache.log4j.Category debug
 FINE: Reading reply sessionid:0x12a97312613010b, packet:: clientPath:null
 serverPath:null finished:false header:: 540,8  replyHeader:: 540,-1,0
  request:: '/collections,F  response:: v{'ENPwl,'ENPwlMaster}
 Aug 25, 2010 5:18:19 AM org.apache.solr.common.cloud.ZkStateReader
 updateCloudState
 INFO: Cloud state update for ZooKeeper already scheduled
 Aug 25, 2010 5:18:19 AM org.apache.log4j.Category error
 SEVERE: Error while calling watcher
 java.lang.IllegalArgumentException: Path cannot be null
at
 org.apache.zookeeper.common.PathUtils.validatePath(PathUtils.java:45)
at
 org.apache.zookeeper.ZooKeeper.getChildren(zookeeper:ZooKeeper.java):1196)
at
 org.apache.solr.common.cloud.SolrZkClient.getChildren(SolrZkClient.java:200)
at
 org.apache.solr.common.cloud.ZkStateReader$5.process(ZkStateReader.java:315)
at
 org.apache.zookeeper.ClientCnxn$EventThread.run(zookeeper:ClientCnxn.java):425)
 Aug 25, 2010 5:18:19 AM org.apache.solr.common.cloud.ZkStateReader$4
 process
 INFO: Detected a shard change under ShardId:ENPWL3 in collection:ENPwl
 Aug 25, 2010 5:18:19 AM org.apache.solr.common.cloud.ZkStateReader
 updateCloudState
 INFO: Cloud state update for ZooKeeper already scheduled
 Aug 25, 2010 5:18:19 AM org.apache.solr.common.cloud.ZkStateReader$4
 process
 INFO: Detected a shard change under ShardId:ENPWL4 in collection:ENPwl
 Aug 25, 2010 5:18:19 AM org.apache.solr.common.cloud.ZkStateReader
 updateCloudState
 INFO: Cloud state update for ZooKeeper already scheduled
 Aug 25, 2010 5:18:19 AM org.apache.solr.common.cloud.ZkStateReader$4
 process
 INFO: Detected a shard change under ShardId:ENPWL1 in collection:ENPwl
 Aug 25, 2010 5:18:19 AM org.apache.solr.common.cloud.ZkStateReader
 updateCloudState
 INFO: Cloud state update for ZooKeeper already scheduled
 Aug 25, 2010 5:18:19 AM org.apache.solr.cloud.ZkController$2 process
 INFO: Updating live
 nodes:org.apache.solr.common.cloud.solrzkcli...@55308275
 Aug 25, 2010 5:18:19 AM org.apache.solr.common.cloud.ZkStateReader
 updateCloudState
 INFO: Updating live nodes from ZooKeeper...
 Aug 25, 2010 5:18:19 AM org.apache.log4j.Category debug
 FINE: Reading reply sessionid:0x12a97312613010b, packet:: clientPath:null
 serverPath:null finished:false header:: 541,8  replyHeader:: 541,-1,0
  request:: '/live_nodes,F  response:: v{'ob1078.nydc1.outbrain.com:8983
 _solr2,'ob1078.nydc1.outbrain.com:8983
 _solr1,'ob1061.nydc1.outbrain.com:8983
 _solr2,'ob1062.nydc1.outbrain.com:8983
 _solr1,'ob1062.nydc1.outbrain.com:8983
 _solr2,'ob1061.nydc1.outbrain.com:8983
 _solr1,'ob1077.nydc1.outbrain.com:8983
 _solr2,'ob1077.nydc1.outbrain.com:8983_solr1}
 Aug 25, 2010 5:18:19 AM org.apache.log4j.Category error
 SEVERE: Error while calling watcher
 java.lang.IllegalArgumentException: Path cannot be null
at
 org.apache.zookeeper.common.PathUtils.validatePath(PathUtils.java:45)
at
 org.apache.zookeeper.ZooKeeper.getChildren(zookeeper:ZooKeeper.java):1196)
at
 org.apache.solr.common.cloud.SolrZkClient.getChildren(SolrZkClient.java:200)
at
 org.apache.solr.cloud.ZkController$2.process(ZkController.java:321)
at
 org.apache.zookeeper.ClientCnxn$EventThread.run(zookeeper:ClientCnxn.java):425)
 Aug 25, 2010 5:18:19 AM 

Re: Receiving create events for self with synchronous create

2010-08-30 Thread Patrick Hunt
On line 64 are you ensuring that the ZooKeeper session is active before
executing that sequence?

zookeeper = new ZooKeeper(...) is async - it returns before you're actually
connected to the server (you get notified of this in your watcher). If you
execute this sequence quickly enough your zk.create operation is queued
until the zookeeper session is actually established.

Patrick

On Thu, Aug 26, 2010 at 8:09 PM, Todd Nine t...@spidertracks.co.nz wrote:

 Sure thing.  The FollowerWatcher class is instantiated by the
 IClusterManager implementation.It then performs the following

 FollowerWatcher.init() which is intended to do the following.

 1. Create our follower node so that other nodes know we exist at path
 /com/spidertracks/aviator/cluster/follower/10.0.1.1  where the last
 node is an ephemeral node with the internal IP address of the node.
 These are lines 67 through 72.
 2. Signal to the clusterManager that the cluster has changed (line 79).
 Ultimately the clusterManager will perform a barrier for partitioning
 data ( a separate watcher)
 3. Register a watcher to receive all future events on the follower path
 /com/spidertracks/aviator/cluster/follower/ line 81.


 Then we have the following characteristics in the watcher

 1. If a node has been added or deleted from the children of
 /com/spidertracks/aviator/cluster/follower then continue.  Otherwise,
 ignore the event.  Lines 33 through 44
 2. If this was an event we should process our cluster has changed,
 signal to the CusterManager that a node has either been added or
 removed. line 51.


 I'm trying to encapsulate the detection of additions and deletions of
 child nodes within this Watcher.  All other events that occur due to a
 node being added or deleted should be handled externally by the
 clustermanager.

 Thanks,
 Todd


 On Thu, 2010-08-26 at 19:26 -0700, Mahadev Konar wrote:

  Hi Todd,
The code that you point to, I am not able to make out the sequence
  of steps.
 Can you be more clear on what you are trying to do in terms of
  zookeeper api?
 
  Thanks
  mahadev
  On 8/26/10 5:58 PM, Todd Nine t...@spidertracks.co.nz wrote:
 
 
  Hi all,
I'm running into a strange issue I could use a hand with.
I've
  implemented leader election, and this is working well.  I'm
  now
  implementing a follower queue with ephemeral nodes. I have an
  interface
  IClusterManager which simply has the api clusterChanged.  I
  don't care
  if nodes are added or deleted, I always want to fire this
  event.  I have
  the following basic algorithm.
 
 
  init
 
  Create a path with /follower/+mynode name
 
  fire the clusterChangedEvent
 
  Watch set the event watcher on the path /follower.
 
 
  watch:
 
  reset the watch on /follower
 
  if event is not a NodeDeleted or NodeCreated, ignore
 
  fire the clustermanager event
 
 
  this seems pretty straightforward.  Here is what I'm expecting
 
 
  1. Create my node path
  2. fire the clusterChanged event
  3. Set watch on /follower
  4. Receive watch events for changes from any other nodes.
 
  What's actually happening
 
  1. Create my node path
  2. fire the clusterChanged event
  3. Set Watch on /follower
  4. Receive watch event for node created in step 1
  5. Receive future watch events for changes from any other
  nodes.
 
 
  Here is my code.  Since I set the watch after I create the
  node, I'm not
  expecting to receive the event for it.  Am I doing something
  incorrectly
  in creating my watch?  Here is my code.
 
  http://pastebin.com/zDXgLagd
 
  Thanks,
  Todd
 
 
 
 
 



Re: Exception causing close of session

2010-08-30 Thread Patrick Hunt
No, by reset I meant purging the ZK database (rm -fr /zkdatadir). I've
seen a number of cases like this now, where a user plays with hbase for a
while and wants to reset back to a state with no data in hbase. They
shutdown some of the hbase/zk processes but not all of them (and as a result
old zk sessions are hanging around). Really we should invalidate the
session:
https://issues.apache.org/jira/browse/ZOOKEEPER-583

Patrick

On Fri, Aug 27, 2010 at 12:00 PM, Ted Dunning ted.dunn...@gmail.com wrote:

 Patrick,

 Can you clarify what reset means?  It doesn't mean just restart, does it?

 On Thu, Aug 26, 2010 at 5:05 PM, Patrick Hunt ph...@apache.org wrote:

   Client has seen zxid 0xfa4 our last zxid is 0x42
 
  Someone reset the zk server database without restarting the clients. As a
  result the client is forward in time relative to the cluster.
 
  Patrick
 
 
  On 08/26/2010 04:03 PM, Ted Yu wrote:
 
  Hi,
  zookeeper-3.2.2 is used out of HBase 0.20.5
 
  Linux sjc1-.com 2.6.18-92.el5 #1 SMP Tue Jun 10 18:51:06 EDT 2008 x86_64
  x86_64 x86_64 GNU/Linux
 
  In hbase-hadoop-zookeeper-sjc1-cml-grid00.log, I see a lot of the
  following:
 
  2010-08-26 22:58:01,930 INFO org.apache.zookeeper.server.NIOServerCnxn:
  closing session:0x0 NIOServerCnxn:
  java.nio.channels.SocketChannel[connected
  local=/10.201.9.40:2181 remote=/10.201.9.22:63316]
  2010-08-26 22:58:02,097 INFO org.apache.zookeeper.server.NIOServerCnxn:
  Connected to /10.201.9.22:63317 lastZxid 4004
  2010-08-26 22:58:02,097 WARN org.apache.zookeeper.server.NIOServerCnxn:
  Client has seen zxid 0xfa4 our last zxid is 0x42
  2010-08-26 22:58:02,097 WARN org.apache.zookeeper.server.NIOServerCnxn:
  Exception causing close of session 0x0 due to java.io.IOException:
 Client
  has seen zxid 0xfa4 our last zxid is 0x42
 
  If you can shed some thought on root cause, that would be great.
 
 



Logs and in memory operations

2010-08-30 Thread Avinash Lakshman
Hi All

From my understanding when a znode is updated/created a write happens into
the local transaction logs and then some in-memory data structure is updated
to serve the future reads.
Where in the source code can I find this? Also how can I decide when it is
ok for me to delete the logs off disk?

Please advice.

Cheers
Avinash