[ https://issues.apache.org/jira/browse/ZOOKEEPER-1381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13294302#comment-13294302 ]
nkeywal commented on ZOOKEEPER-1381: ------------------------------------ It's something I can reproduce using 'multi' on a 3.3 ZK server, for example with this: {noformat} public void testMulti() throws Exception { ZooKeeper zk = new ZooKeeper("127.0.0.1", 30000, null); List<Op> ops = new ArrayList<Op>(); ops.add(Op.create("/m1", null, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL)); ops.add(Op.create("/m2", null, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL)); zk.multi(ops); zk.close(); } {noformat} The issue seems to be on the server side, it drops the packet with an unknown OpCode in ZooKeeperServer#submitRequest {noformat} public void submitRequest(Request si) { // snip try { touch(si.cnxn); boolean validpacket = Request.isValid(si.type); // ===> Check on case OpCode.* if (validpacket) { // snip } else { LOG.warn("Dropping packet at server of type " + si.type); // if invalid packet drop the packet. } } catch (MissingSessionException e) { if (LOG.isDebugEnabled()) { LOG.debug("Dropping request: " + e.getMessage()); } } } {noformat} > Add a method to get the zookeeper server version from the client > ---------------------------------------------------------------- > > Key: ZOOKEEPER-1381 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1381 > Project: ZooKeeper > Issue Type: Improvement > Components: c client, documentation, java client, server > Affects Versions: 3.4.2 > Environment: all > Reporter: nkeywal > Priority: Minor > Labels: newbie > > Zookeeper client API is designed to be server version agnostic as much as > possible, so we can have new clients with old servers (or the opposite). But > there is today no simple way for a client to know what's the server version. > This would be very useful in order to; > - check the compatibility (ex: 'multi' implementation available since 3.4 > while 3.4 clients API supports 3.3 servers as well) > - have different implementation depending on the server functionalities > A workaround (proposed by Mahadev Konar) is do "echo stat | nc hostname > clientport" and parse the output to get the version. The output is, for > example: > ----------------------- > Zookeeper version: 3.4.2--1, built on 01/30/2012 17:43 GMT > Clients: > /127.0.0.1:54951[0](queued=0,recved=1,sent=0) > Latency min/avg/max: 0/0/0 > Received: 1 > Sent: 0 > Outstanding: 0 > Zxid: 0x500000001 > Mode: follower > Node count: 7 > -------------------- -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira