[ https://issues.apache.org/jira/browse/ZOOKEEPER-1485?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Kuchta updated ZOOKEEPER-1485: ------------------------------------- Attachment: ZOOKEEPER-1485.patch I am uploading a patch that takes the approach of wrapping the XID around when the max value is reached. The Java client and both multi- and single-threaded C implementations have been modified. They also now all initialize the XID to 1 to match the Java client's behavior (the C implementations used epoch time before), though I don't think it matters. We're likely going to deploy this fix internally, since we're hitting the overflow issue somewhat frequently given the number of ZooKeeper deployments we have and the volume of requests they're processing. It sounds like [~fanster.z] fixed the issue in a similar way. We can discuss whether mainline ZooKeeper should take a different approach toward fixing this based on the points made above. > client xid overflow is not handled > ---------------------------------- > > Key: ZOOKEEPER-1485 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1485 > Project: ZooKeeper > Issue Type: Bug > Components: c client, java client > Affects Versions: 3.4.3, 3.3.5 > Reporter: Michi Mutsuzaki > Assignee: Martin Kuchta > Attachments: ZOOKEEPER-1485.patch > > > Both Java and C clients use signed 32-bit int as XIDs. XIDs are assumed to be > non-negative, and zookeeper uses some negative values as special XIDs (e.g. > -2 for ping, -4 for auth). However, neither Java nor C client ensures the > XIDs it generates are non-negative, and the server doesn't reject negative > XIDs. > Pat had some suggestions on how to fix this: > - (bin-compat) Expire the session when the client sends a negative XID. > - (bin-incompat) In addition to expiring the session, use 64-bit int for XID > so that overflow will practically never happen. > --Michi -- This message was sent by Atlassian JIRA (v6.3.4#6332)