[jira] Updated: (ZOOKEEPER-530) Memory corruption: Zookeeper c client IPv6 implementation does not honor struct sockaddr_in6 size

2009-10-15 Thread Isabel Drost (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-530?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Isabel Drost updated ZOOKEEPER-530:
---

Status: Patch Available  (was: Open)

 Memory corruption: Zookeeper c client IPv6 implementation does not honor 
 struct sockaddr_in6 size
 -

 Key: ZOOKEEPER-530
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-530
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.1, 3.2.0
Reporter: Isabel Drost
Assignee: Isabel Drost
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-530.patch


 I tried to run zookeeper c-client on a machine with IPv6 enabled. When 
 connecting to the IPv6 address a connect(...) gave a Address family not 
 supported by protocol error. The reason was, that a few lines earlier, the 
 socket was opened with PF_INET instead of PF_INET6. Changing that the 
 following way:
 {code}
if (zh-addrs[zh-connect_index].sa_family == AF_INET) {
   zh-fd = socket(PF_INET, SOCK_STREAM, 0);
 } else {
   zh-fd = socket(PF_INET6, SOCK_STREAM, 0);
 }
 {code}
 turned the error message into Invalid argument. 
 When printing out sizeof(struct sockaddr), sizeof(struct sockaddr_in) and 
 sizeof(struct sockaddr_in6) I got sockaddr: 16, sockaddr_in: 16 and 
 sockaddr_in6: 28. 
 So in the code calling 
 {code}
connect(zh-fd, zh-addrs[zh-connect_index], sizeof(struct 
 sockaddr_in));
 {code}
 the parameter address_len is too small.
 Same applies to how IPv6 addresses are handled in the function 
 getaddrs(zhandle_t *zh).
 (Big Thanks+kiss to Thilo Fromm for helping me debug this.)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (ZOOKEEPER-530) Memory corruption: Zookeeper c client IPv6 implementation does not honor struct sockaddr_in6 size

2009-10-15 Thread Isabel Drost (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12765945#action_12765945
 ] 

Isabel Drost commented on ZOOKEEPER-530:


As explained above, I just tried to use the c-client on a 64bit system with 
IPv6 support (SuSE 10.3), when connecting to the server I got the errors from 
above - not consistently though: Whenever the client decided to connect to the 
IPv4 address all would work fine. So running the existing tests on a IPv6 only, 
64bit system should do the trick, I do not know what a test that checks exactly 
that scenario might look like.

 Memory corruption: Zookeeper c client IPv6 implementation does not honor 
 struct sockaddr_in6 size
 -

 Key: ZOOKEEPER-530
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-530
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.0, 3.2.1
Reporter: Isabel Drost
Assignee: Isabel Drost
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-530.patch


 I tried to run zookeeper c-client on a machine with IPv6 enabled. When 
 connecting to the IPv6 address a connect(...) gave a Address family not 
 supported by protocol error. The reason was, that a few lines earlier, the 
 socket was opened with PF_INET instead of PF_INET6. Changing that the 
 following way:
 {code}
if (zh-addrs[zh-connect_index].sa_family == AF_INET) {
   zh-fd = socket(PF_INET, SOCK_STREAM, 0);
 } else {
   zh-fd = socket(PF_INET6, SOCK_STREAM, 0);
 }
 {code}
 turned the error message into Invalid argument. 
 When printing out sizeof(struct sockaddr), sizeof(struct sockaddr_in) and 
 sizeof(struct sockaddr_in6) I got sockaddr: 16, sockaddr_in: 16 and 
 sockaddr_in6: 28. 
 So in the code calling 
 {code}
connect(zh-fd, zh-addrs[zh-connect_index], sizeof(struct 
 sockaddr_in));
 {code}
 the parameter address_len is too small.
 Same applies to how IPv6 addresses are handled in the function 
 getaddrs(zhandle_t *zh).
 (Big Thanks+kiss to Thilo Fromm for helping me debug this.)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (ZOOKEEPER-530) Memory corruption: Zookeeper c client IPv6 implementation does not honor struct sockaddr_in6 size

2009-10-15 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12765950#action_12765950
 ] 

Hadoop QA commented on ZOOKEEPER-530:
-

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12420179/ZOOKEEPER-530.patch
  against trunk revision 824981.

+1 @author.  The patch does not contain any @author tags.

-1 tests included.  The patch doesn't appear to include any new or modified 
tests.
Please justify why no tests are needed for this patch.

+1 javadoc.  The javadoc tool did not generate any warning messages.

+1 javac.  The applied patch does not increase the total number of javac 
compiler warnings.

+1 findbugs.  The patch does not introduce any new Findbugs warnings.

+1 release audit.  The applied patch does not increase the total number of 
release audit warnings.

+1 core tests.  The patch passed core unit tests.

+1 contrib tests.  The patch passed contrib unit tests.

Test results: 
http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/26/testReport/
Findbugs warnings: 
http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/26/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: 
http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/26/console

This message is automatically generated.

 Memory corruption: Zookeeper c client IPv6 implementation does not honor 
 struct sockaddr_in6 size
 -

 Key: ZOOKEEPER-530
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-530
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.0, 3.2.1
Reporter: Isabel Drost
Assignee: Isabel Drost
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-530.patch


 I tried to run zookeeper c-client on a machine with IPv6 enabled. When 
 connecting to the IPv6 address a connect(...) gave a Address family not 
 supported by protocol error. The reason was, that a few lines earlier, the 
 socket was opened with PF_INET instead of PF_INET6. Changing that the 
 following way:
 {code}
if (zh-addrs[zh-connect_index].sa_family == AF_INET) {
   zh-fd = socket(PF_INET, SOCK_STREAM, 0);
 } else {
   zh-fd = socket(PF_INET6, SOCK_STREAM, 0);
 }
 {code}
 turned the error message into Invalid argument. 
 When printing out sizeof(struct sockaddr), sizeof(struct sockaddr_in) and 
 sizeof(struct sockaddr_in6) I got sockaddr: 16, sockaddr_in: 16 and 
 sockaddr_in6: 28. 
 So in the code calling 
 {code}
connect(zh-fd, zh-addrs[zh-connect_index], sizeof(struct 
 sockaddr_in));
 {code}
 the parameter address_len is too small.
 Same applies to how IPv6 addresses are handled in the function 
 getaddrs(zhandle_t *zh).
 (Big Thanks+kiss to Thilo Fromm for helping me debug this.)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



Build failed in Hudson: ZooKeeper-trunk #498

2009-10-15 Thread Apache Hudson Server
See http://hudson.zones.apache.org/hudson/job/ZooKeeper-trunk/498/

--
[...truncated 80593 lines...]
[junit] 2009-10-15 10:38:35,968 - INFO  [main:zookee...@502] - Closing 
session: 0x12457c7019c
[junit] 2009-10-15 10:38:35,968 - INFO  [main:clientc...@1070] - Closing 
ClientCnxn for session: 0x12457c7019c
[junit] 2009-10-15 10:38:35,969 - INFO  
[ProcessThread:-1:preprequestproces...@384] - Processed session termination 
request for id: 0x12457c7019c
[junit] 2009-10-15 10:38:35,970 - INFO  [SyncThread:0:nioserverc...@834] - 
closing session:0x12457c7019c NIOServerCnxn: 
java.nio.channels.SocketChannel[connected local=/127.0.0.1:11225 
remote=/127.0.0.1:50402]
[junit] 2009-10-15 10:38:35,970 - INFO  
[main-SendThread(localhost:11225):clientcnxn$sendthr...@963] - Exception while 
closing send thread for session 0x12457c7019c : Read error rc = -1 
java.nio.DirectByteBuffer[pos=0 lim=4 cap=4]
[junit] 2009-10-15 10:38:36,000 - INFO  
[SessionTracker:sessiontrackeri...@143] - SessionTrackerImpl exited loop!
[junit] 2009-10-15 10:38:36,071 - INFO  [main:clientc...@1056] - 
Disconnecting ClientCnxn for session: 0x12457c7019c
[junit] 2009-10-15 10:38:36,071 - INFO  [main:zookee...@510] - Session: 
0x12457c7019c closed
[junit] 2009-10-15 10:38:36,071 - INFO  
[main-EventThread:clientcnxn$eventthr...@514] - EventThread shut down
[junit] 2009-10-15 10:38:36,071 - INFO  [main:clientb...@397] - tearDown 
starting
[junit] 2009-10-15 10:38:36,072 - INFO  [main:clientb...@409] - fdcount 
after test is: 37
[junit] 2009-10-15 10:38:36,072 - INFO  [main:zookee...@502] - Closing 
session: 0x12457c7019c
[junit] 2009-10-15 10:38:36,072 - INFO  [main:clientc...@1070] - Closing 
ClientCnxn for session: 0x12457c7019c
[junit] 2009-10-15 10:38:36,072 - INFO  [main:clientc...@1056] - 
Disconnecting ClientCnxn for session: 0x12457c7019c
[junit] 2009-10-15 10:38:36,073 - INFO  [main:zookee...@510] - Session: 
0x12457c7019c closed
[junit] 2009-10-15 10:38:36,073 - INFO  [main:clientb...@374] - STOPPING 
server
[junit] 2009-10-15 10:38:36,073 - INFO  
[NIOServerCxn.Factory:11225:nioservercnxn$fact...@236] - NIOServerCnxn factory 
exited run method
[junit] 2009-10-15 10:38:36,073 - INFO  [main:finalrequestproces...@283] - 
shutdown of request processor complete
[junit] 2009-10-15 10:38:36,073 - INFO  
[ProcessThread:-1:preprequestproces...@119] - PrepRequestProcessor exited loop!
[junit] 2009-10-15 10:38:36,073 - INFO  
[SyncThread:0:syncrequestproces...@134] - SyncRequestProcessor exited!
[junit] ensureOnly:[]
[junit] 2009-10-15 10:38:36,088 - INFO  [main:clientb...@428] - FINISHED 
testWatcherAutoResetDisabledWithGlobal
[junit] 2009-10-15 10:38:36,089 - INFO  [main:clientb...@338] - STARTING 
testWatcherAutoResetDisabledWithLocal
[junit] 2009-10-15 10:38:36,094 - INFO  [main:clientb...@367] - STARTING 
server
[junit] 2009-10-15 10:38:36,095 - INFO  [main:zookeeperser...@160] - 
Created server
[junit] 2009-10-15 10:38:36,095 - INFO  [main:nioservercnxn$fact...@122] - 
binding to port 11226
[junit] 2009-10-15 10:38:36,096 - INFO  [main:filetxnsnap...@208] - 
Snapshotting: 0
[junit] ensureOnly:[InMemoryDataTree, StandaloneServer_port]
[junit] 2009-10-15 10:38:36,097 - INFO  
[NIOServerCxn.Factory:11226:nioserverc...@699] - Processing stat command from 
/127.0.0.1:36680
[junit] 2009-10-15 10:38:36,098 - WARN  
[NIOServerCxn.Factory:11226:nioserverc...@495] - Exception causing close of 
session 0x0 due to java.io.IOException: Responded to info probe
[junit] 2009-10-15 10:38:36,098 - INFO  
[NIOServerCxn.Factory:11226:nioserverc...@834] - closing session:0x0 
NIOServerCnxn: java.nio.channels.SocketChannel[connected local=/127.0.0.1:11226 
remote=/127.0.0.1:36680]
[junit] expect:InMemoryDataTree
[junit] found:InMemoryDataTree 
org.apache.ZooKeeperService:name0=StandaloneServer_port-1,name1=InMemoryDataTree
[junit] expect:StandaloneServer_port
[junit] found:StandaloneServer_port 
org.apache.ZooKeeperService:name0=StandaloneServer_port-1
[junit] 2009-10-15 10:38:36,099 - INFO  [main:clientb...@359] - Initial 
fdcount is: 37
[junit] 2009-10-15 10:38:36,099 - INFO  [main:clientb...@363] - Client test 
setup finished
[junit] 2009-10-15 10:38:36,099 - INFO  [main:zookee...@369] - Initiating 
client connection, connectString=127.0.0.1:11226 sessionTimeout=5000 
watcher=org.apache.zookeeper.test.watchertest$mywatc...@1786a3c
[junit] 2009-10-15 10:38:36,100 - INFO  
[main-SendThread():clientcnxn$sendthr...@869] - Attempting connection to server 
/127.0.0.1:11226
[junit] 2009-10-15 10:38:36,100 - INFO  
[main-SendThread(localhost:11226):clientcnxn$sendthr...@785] - Priming 
connection to java.nio.channels.SocketChannel[connected local=/127.0.0.1:36681 
remote=localhost/127.0.0.1:11226]
[junit] 2009-10-15 

[jira] Created: (ZOOKEEPER-555) Add stat information to GetChildrenResponse

2009-10-15 Thread JIRA
Add stat information to GetChildrenResponse
---

 Key: ZOOKEEPER-555
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-555
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, contrib-bindings, java client, server
Reporter: Árni Már Jónsson
Priority: Minor


GetChildren() is the only non-create/delete API which does not include the node 
stat information. I propose that the definition of GetChildren() should be:

class GetChildrenResponse {
vectorustring children;
org.apache.zookeeper.data.Stat stat;
}

There is a trivial fix to the server (FinalRequestProcessor.java): rsp = new 
GetChildrenResponse(children, stat);

And something similar to the  client library.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-555) Add stat information to GetChildrenResponse

2009-10-15 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-555?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Árni Már Jónsson updated ZOOKEEPER-555:
---

Attachment: getchildren_stat.patch

getchildren stat patch

 Add stat information to GetChildrenResponse
 ---

 Key: ZOOKEEPER-555
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-555
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, contrib-bindings, java client, server
Affects Versions: 3.3.0
Reporter: Árni Már Jónsson
Priority: Minor
 Fix For: 3.3.0

 Attachments: getchildren_stat.patch


 GetChildren() is the only non-create/delete API which does not include the 
 node stat information. I propose that the definition of GetChildren() should 
 be:
 class GetChildrenResponse {
 vectorustring children;
 org.apache.zookeeper.data.Stat stat;
 }
 There is a trivial fix to the server (FinalRequestProcessor.java): rsp = new 
 GetChildrenResponse(children, stat);
 And something similar to the  client library.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-555) Add stat information to GetChildrenResponse

2009-10-15 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-555?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Árni Már Jónsson updated ZOOKEEPER-555:
---

Fix Version/s: 3.3.0
Affects Version/s: 3.3.0
 Release Note: Changes required to have Stat returned with 
get_children().
   Status: Patch Available  (was: Open)

Patch for server part (simple), and C client library (complicated).

Tested this using the Python bindings (I have a separate patch for those if 
there is interest).

 Add stat information to GetChildrenResponse
 ---

 Key: ZOOKEEPER-555
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-555
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, contrib-bindings, java client, server
Affects Versions: 3.3.0
Reporter: Árni Már Jónsson
Priority: Minor
 Fix For: 3.3.0

 Attachments: getchildren_stat.patch


 GetChildren() is the only non-create/delete API which does not include the 
 node stat information. I propose that the definition of GetChildren() should 
 be:
 class GetChildrenResponse {
 vectorustring children;
 org.apache.zookeeper.data.Stat stat;
 }
 There is a trivial fix to the server (FinalRequestProcessor.java): rsp = new 
 GetChildrenResponse(children, stat);
 And something similar to the  client library.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (ZOOKEEPER-555) Add stat information to GetChildrenResponse

2009-10-15 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12766087#action_12766087
 ] 

Hadoop QA commented on ZOOKEEPER-555:
-

-1 overall.  Here are the results of testing the latest attachment 
  
http://issues.apache.org/jira/secure/attachment/12422239/getchildren_stat.patch
  against trunk revision 824981.

+1 @author.  The patch does not contain any @author tags.

-1 tests included.  The patch doesn't appear to include any new or modified 
tests.
Please justify why no tests are needed for this patch.

-1 patch.  The patch command could not apply the patch.

Console output: 
http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h8.grid.sp2.yahoo.net/27/console

This message is automatically generated.

 Add stat information to GetChildrenResponse
 ---

 Key: ZOOKEEPER-555
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-555
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, contrib-bindings, java client, server
Affects Versions: 3.3.0
Reporter: Árni Már Jónsson
Priority: Minor
 Fix For: 3.3.0

 Attachments: getchildren_stat.patch


 GetChildren() is the only non-create/delete API which does not include the 
 node stat information. I propose that the definition of GetChildren() should 
 be:
 class GetChildrenResponse {
 vectorustring children;
 org.apache.zookeeper.data.Stat stat;
 }
 There is a trivial fix to the server (FinalRequestProcessor.java): rsp = new 
 GetChildrenResponse(children, stat);
 And something similar to the  client library.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (ZOOKEEPER-549) Refactor Followers and related classes into a Peer-Follower hierarchy in preparation for Observers

2009-10-15 Thread Flavio Paiva Junqueira (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12766096#action_12766096
 ] 

Flavio Paiva Junqueira commented on ZOOKEEPER-549:
--

Thanks, Henry, the patch looks good. I have a couple of high level comments:

* I think we should call Peer* classes something else because calling them 
Peer gives the idea that it contains functionality that belongs to leaders, 
followers, and observers. Leader does not extend Peer, though. Also, we already 
have a QuorumPeer class (and related classes), which makes it. In my 
interpretation, the common functionality between followers and observers is 
that they commit (learn) transactions, so we could call it a Committer or a 
Learner. I personally prefer the latter, and I'm obviously interested in other 
suggestions;
* Most likely this should be a separate jira, but I'd like to propose that 
split the package structure further, in particular for the quorum package. I 
suggest: quorum.leader, quorum.peer, quorum.learner, quorum.le. 

 Refactor Followers and related classes into a Peer-Follower hierarchy in 
 preparation for Observers
 ---

 Key: ZOOKEEPER-549
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-549
 Project: Zookeeper
  Issue Type: Improvement
  Components: quorum, server
Affects Versions: 3.2.1
Reporter: Henry Robinson
Assignee: Henry Robinson
 Fix For: 3.3.0

 Attachments: ZOOKEEPER-549.patch, ZOOKEEPER-549.patch


 For the Observers patch (ZOOKEEPER-368), a lot of functionality is shared 
 between Followers and Observers. To avoid copying code, it makes sense to 
 push the common code into a parent Peer class and specialise it for Followers 
 and Observers. At the same time, some of the lengthier methods in Follower 
 can be broken up to make the code more readable. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (ZOOKEEPER-555) Add stat information to GetChildrenResponse

2009-10-15 Thread Patrick Hunt (JIRA)

 [ 
https://issues.apache.org/jira/browse/ZOOKEEPER-555?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Patrick Hunt updated ZOOKEEPER-555:
---

Assignee: Árni Már Jónsson
  Status: Open  (was: Patch Available)

I think this is a reasonable thing to add. Could you explain the use case where 
this is necessary?

However there are some issues with the patch that need to be addressed:

1) we require all changes in minor/fix releases to be b/w compatible and 
generally we try to do non-b/w compatible 
changes very infrequently. When you are running a highly available/reliable 
service you don't want to have to tell
ppl shutdown  upgrade all of your servers and clients when you upgrade to 
this version. The changes
as currently implemented change both the API and wire protocol for existing 
functionality, this is not
something we can accept.

However,  a simple workaround would be to add a new protocol (jute) type, and 
additional functions/callbacks
to support getting children including the stat. Take a look at zoo_set2 in the 
c source, this is an example where
simliar issue has happened before (although in that case jute had the stat, we 
just weren't providing it to
the user as part of the api for zoo_set, so zoo_set2 was added). So 
*get_children2(... in the C case and
probably just overload getChildren in java to have additional Stat param tacked 
onto the end.

2) there need to be tests included in the patch that verify this functionality

3) no tabs in the source, spaces only for indentation


*Note to reviewer*: ensure that the implementation ensures that the version 
fields in the stat correspond to
the child list returned (ie they are the same version, this is important if ppl 
start using the cversion 
correlated with the child list itself)



 Add stat information to GetChildrenResponse
 ---

 Key: ZOOKEEPER-555
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-555
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, contrib-bindings, java client, server
Affects Versions: 3.3.0
Reporter: Árni Már Jónsson
Assignee: Árni Már Jónsson
Priority: Minor
 Fix For: 3.3.0

 Attachments: getchildren_stat.patch


 GetChildren() is the only non-create/delete API which does not include the 
 node stat information. I propose that the definition of GetChildren() should 
 be:
 class GetChildrenResponse {
 vectorustring children;
 org.apache.zookeeper.data.Stat stat;
 }
 There is a trivial fix to the server (FinalRequestProcessor.java): rsp = new 
 GetChildrenResponse(children, stat);
 And something similar to the  client library.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (ZOOKEEPER-555) Add stat information to GetChildrenResponse

2009-10-15 Thread JIRA

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12766127#action_12766127
 ] 

Árni Már Jónsson commented on ZOOKEEPER-555:


Hi,

Thank you for the advice.

The use case I'm interested involves leader election. I have a set servers, 1 
master and multiple slaves. Each server publishes an ephemeral sequence child 
znode into a commonly known znode, of the form host:port. The first node 
(sorted on the sequence number) is considered to be the master. The servers 
only publish their existence, and are generally not aware of each other.

Clients are responsible for notifying the servers if they are master, or if 
they are slaves, and if so who is the master. They do this when they first read 
the child list, and each time the child list changes.  The notifications are 
idempotent, but if e.g. the list changes 2 times, and one client is able to 
notify the servers of both version before some other client sees them, the 
servers will have their status changes 4 times instead of 2. Worst case is N x 
#clients, for N changes, instead of N.

I'd like to keep the cost of these as small as possible. One way is to include 
the child list version number with the notification, and have the server only 
accept it, if the version is larger than one seen before.

I'll prepare a new patch which fits your requirements.

 Add stat information to GetChildrenResponse
 ---

 Key: ZOOKEEPER-555
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-555
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, contrib-bindings, java client, server
Affects Versions: 3.3.0
Reporter: Árni Már Jónsson
Assignee: Árni Már Jónsson
Priority: Minor
 Fix For: 3.3.0

 Attachments: getchildren_stat.patch


 GetChildren() is the only non-create/delete API which does not include the 
 node stat information. I propose that the definition of GetChildren() should 
 be:
 class GetChildrenResponse {
 vectorustring children;
 org.apache.zookeeper.data.Stat stat;
 }
 There is a trivial fix to the server (FinalRequestProcessor.java): rsp = new 
 GetChildrenResponse(children, stat);
 And something similar to the  client library.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (ZOOKEEPER-555) Add stat information to GetChildrenResponse

2009-10-15 Thread Patrick Hunt (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12766154#action_12766154
 ] 

Patrick Hunt commented on ZOOKEEPER-555:


That sounds reasonable. 

Alternately, might you use the sequence numbers themselves to ascertain the 
version?

I was thinking something like: you have a child list with seq numbers

version = x,y  where x is count, y is last seq number

1 2 3 = version is 3,3
znode 2 drops
1 3 = version is 2,3
a new znode is added
1 3 4 = version is 3,4

so the server would see 3,3 2,3 3,3 2,3 in your example

x,y where x can only decrease as time increases unless y increases. therefore 
the second 3,3 2,3 would be ignored (ie old version)

 Add stat information to GetChildrenResponse
 ---

 Key: ZOOKEEPER-555
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-555
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, contrib-bindings, java client, server
Affects Versions: 3.3.0
Reporter: Árni Már Jónsson
Assignee: Árni Már Jónsson
Priority: Minor
 Fix For: 3.3.0

 Attachments: getchildren_stat.patch


 GetChildren() is the only non-create/delete API which does not include the 
 node stat information. I propose that the definition of GetChildren() should 
 be:
 class GetChildrenResponse {
 vectorustring children;
 org.apache.zookeeper.data.Stat stat;
 }
 There is a trivial fix to the server (FinalRequestProcessor.java): rsp = new 
 GetChildrenResponse(children, stat);
 And something similar to the  client library.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (ZOOKEEPER-555) Add stat information to GetChildrenResponse

2009-10-15 Thread JIRA

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12766336#action_12766336
 ] 

Árni Már Jónsson commented on ZOOKEEPER-555:


That's clever. The 2-tuple (y, -x) would give a total version order. Cool 
things those sequence nodes.

I'll see tomorrow if I'm still motivated to finish the patch.

Thanks.


 Add stat information to GetChildrenResponse
 ---

 Key: ZOOKEEPER-555
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-555
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, contrib-bindings, java client, server
Affects Versions: 3.3.0
Reporter: Árni Már Jónsson
Assignee: Árni Már Jónsson
Priority: Minor
 Fix For: 3.3.0

 Attachments: getchildren_stat.patch


 GetChildren() is the only non-create/delete API which does not include the 
 node stat information. I propose that the definition of GetChildren() should 
 be:
 class GetChildrenResponse {
 vectorustring children;
 org.apache.zookeeper.data.Stat stat;
 }
 There is a trivial fix to the server (FinalRequestProcessor.java): rsp = new 
 GetChildrenResponse(children, stat);
 And something similar to the  client library.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (ZOOKEEPER-555) Add stat information to GetChildrenResponse

2009-10-15 Thread Mahadev konar (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12766358#action_12766358
 ] 

Mahadev konar commented on ZOOKEEPER-555:
-

was just reading through this ... very clever solution pat!  

 Add stat information to GetChildrenResponse
 ---

 Key: ZOOKEEPER-555
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-555
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, contrib-bindings, java client, server
Affects Versions: 3.3.0
Reporter: Árni Már Jónsson
Assignee: Árni Már Jónsson
Priority: Minor
 Fix For: 3.3.0

 Attachments: getchildren_stat.patch


 GetChildren() is the only non-create/delete API which does not include the 
 node stat information. I propose that the definition of GetChildren() should 
 be:
 class GetChildrenResponse {
 vectorustring children;
 org.apache.zookeeper.data.Stat stat;
 }
 There is a trivial fix to the server (FinalRequestProcessor.java): rsp = new 
 GetChildrenResponse(children, stat);
 And something similar to the  client library.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (ZOOKEEPER-513) C client disconnect with stand-alone server abnormally

2009-10-15 Thread Mahadev konar (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-513?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12766378#action_12766378
 ] 

Mahadev konar commented on ZOOKEEPER-513:
-

just noticed the CONNECTION REFUSED error at 03:09:20,309:3813. This probably 
indicates that the server went down (the process wasnt running).

Qian,
 As pat mentioned, can you upload the server logs during this time? 


 C client disconnect with stand-alone server abnormally
 --

 Key: ZOOKEEPER-513
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-513
 Project: Zookeeper
  Issue Type: Bug
  Components: c client
Affects Versions: 3.2.0
 Environment: Linux 2.6.9-52bs #2 SMP Fri Jan 26 13:34:38 CST 2007 
 x86_64 x86_64 x86_64 GNU/Linux
 Jdk: 1.6.0_14
Reporter: Qian Ye
 Fix For: 3.3.0


 The client which created an ephemeral node at the zookeeper server, printed 
 the following log
 WARNING: 08-20 03:09:20:  auto * 182894118176 
 [logid:][reqip:][auto_exchanger_zk_basic.cpp:605]get children 
 fail.[/forum/elect_nodes][-7][operation timeout]
 and the Zookeeper client printed the following log (the log level is INFO)
 2009-08-19 21:36:18,067:3813(0x9556c520):zoo_i...@log_env@545: Client 
 environment:zookeeper.version=zookeeper C client 3.2.0
 606 2009-08-19 21:36:18,067:3813(0x9556c520):zoo_i...@log_env@549: Client 
 environment:host.name=jx-ziyuan-test00.jx.baidu.com
 607 2009-08-19 21:36:18,068:3813(0x9556c520):zoo_i...@log_env@557: Client 
 environments.name=Linux
 608 2009-08-19 21:36:18,068:3813(0x9556c520):zoo_i...@log_env@558: Client 
 environments.arch=2.6.9-52bs
 609 2009-08-19 21:36:18,068:3813(0x9556c520):zoo_i...@log_env@559: Client 
 environments.version=#2 SMP Fri Jan 26 13:34:38 CST 2007
 610 2009-08-19 21:36:18,068:3813(0x9556c520):zoo_i...@log_env@567: Client 
 environment:user.name=club
 611 2009-08-19 21:36:18,068:3813(0x9556c520):zoo_i...@log_env@577: Client 
 environment:user.home=/home/club
 612 2009-08-19 21:36:18,068:3813(0x9556c520):zoo_i...@log_env@589: Client 
 environment:user.dir=/home/club/user/luhongbo/auto-exchanger
 613 2009-08-19 21:36:18,068:3813(0x9556c520):zoo_i...@zookeeper_init@613: 
 Initiating client connection, host=127.0.0.1:2181,127.0.0.1:2182 
 sessionTimeout=2000 watcher=0x408c56 sessionId=0x0 
 sessionPasswd=null context=(nil) flags=0
 614 2009-08-19 21:36:18,069:3813(0x41401960):zoo_i...@check_events@1439: 
 initiated connection to server [127.0.0.1:2181]
 615 2009-08-19 21:36:18,070:3813(0x41401960):zoo_i...@check_events@1484: 
 connected to server [127.0.0.1:2181] with session id=1232c1688a20093
 616 2009-08-20 
 02:48:01,780:3813(0x41401960):zoo_w...@zookeeper_interest@1335: Exceeded 
 deadline by 520ms
 617 2009-08-20 
 03:08:52,332:3813(0x41401960):zoo_w...@zookeeper_interest@1335: Exceeded 
 deadline by 14ms
 618 2009-08-20 
 03:09:04,666:3813(0x41401960):zoo_w...@zookeeper_interest@1335: Exceeded 
 deadline by 48ms
 619 2009-08-20 
 03:09:09,733:3813(0x41401960):zoo_w...@zookeeper_interest@1335: Exceeded 
 deadline by 24ms
 620 2009-08-20 
 03:09:20,289:3813(0x41401960):zoo_w...@zookeeper_interest@1335: Exceeded 
 deadline by 264ms
 621 2009-08-20 
 03:09:20,295:3813(0x41401960):zoo_er...@handle_socket_error_msg@1388: Socket 
 [127.0.0.1:2181] zk retcode=-7, errno=110(Connection timed out): conn
 ection timed out (exceeded timeout by 264ms)
 622 2009-08-20 
 03:09:20,309:3813(0x41401960):zoo_w...@zookeeper_interest@1335: Exceeded 
 deadline by 284ms
 623 2009-08-20 
 03:09:20,309:3813(0x41401960):zoo_er...@handle_socket_error_msg@1433: Socket 
 [127.0.0.1:2182] zk retcode=-4, errno=111(Connection refused): server 
 refused to accept the client
 624 2009-08-20 03:09:20,353:3813(0x41401960):zoo_i...@check_events@1439: 
 initiated connection to server [127.0.0.1:2181]
 625 2009-08-20 03:09:20,552:3813(0x41401960):zoo_i...@check_events@1484: 
 connected to server [127.0.0.1:2181] with session id=1232c1688a20093
 The problem happened at 03:09:20, it seems that the zookeeper refused to 
 accept the client, and I don't know why.
 the zoo.cfg is like:
 # The number of milliseconds of each tick
 tickTime=500
 # The number of ticks that the initial 
 # synchronization phase can take
 initLimit=10
 # The number of ticks that can pass between 
 # sending a request and getting an acknowledgement
 syncLimit=5
 # the directory where the snapshot is stored.
 dataDir=./data/
 # the port at which the clients will connect
 clientPort=2181
 the C client used multi-thread library, and the session timeout is set to 
 2000 when the zookeeper handler was initialized.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to 

[jira] Commented: (ZOOKEEPER-555) Add stat information to GetChildrenResponse

2009-10-15 Thread Patrick Hunt (JIRA)

[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12766383#action_12766383
 ] 

Patrick Hunt commented on ZOOKEEPER-555:


I continue to be impressed by the power of just the few primitives/guarantees 
that we provide.

That said,I consider my solution a bit of a hack (not necessarily bad, just not 
optimal), really 
Arni's solution is the correct one, we should provide the ability to get the 
stat as part of the 
get_children. However this (stat) won't be generally available till 3.3 even 
assuming Arni completes
it (please!) and this other alternative might be a good enough solution in the 
mean time.

 Add stat information to GetChildrenResponse
 ---

 Key: ZOOKEEPER-555
 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-555
 Project: Zookeeper
  Issue Type: Improvement
  Components: c client, contrib-bindings, java client, server
Affects Versions: 3.3.0
Reporter: Árni Már Jónsson
Assignee: Árni Már Jónsson
Priority: Minor
 Fix For: 3.3.0

 Attachments: getchildren_stat.patch


 GetChildren() is the only non-create/delete API which does not include the 
 node stat information. I propose that the definition of GetChildren() should 
 be:
 class GetChildrenResponse {
 vectorustring children;
 org.apache.zookeeper.data.Stat stat;
 }
 There is a trivial fix to the server (FinalRequestProcessor.java): rsp = new 
 GetChildrenResponse(children, stat);
 And something similar to the  client library.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.