GitHub user Randgalt opened a pull request:
https://github.com/apache/zookeeper/pull/378
[ZOOKEEPER-2903] Backport of ZOOKEEPER-2901 changes
See https://github.com/apache/zookeeper/pull/377
There was a major oversight when TTL nodes were implemented. The session ID
generator for each server is seeded with the configured Server ID in the high
byte. TTL Nodes were using the highest bit to denote a TTL node when used in
the ephemeral owner. This meant that Server IDs > 127 that created ephemeral
nodes would have those nodes always considered TTL nodes (with the TTL being
essentially a random number).
This PR ports these changes to the 3.5.x branch
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/Randgalt/zookeeper ZOOKEEPER-2903
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/zookeeper/pull/378.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #378
----
commit aa2fe9565306739d6987dcdd0fcb4aa9c032ecfc
Author: randgalt <[email protected]>
Date: 2017-09-23T06:11:19Z
There was a major oversight when TTL nodes were implemented. The session ID
generator for each server is seeded with the configured
Server ID in the high byte. TTL Nodes were using the highest bit to denote
a TTL node when used in the ephemeral owner. This meant
that Server IDs > 127 that created ephemeral nodes would have those nodes
always considered TTL nodes (with the TTL being essentially
a random number).
This PR fixes the issue by disabling TTL Nodes by default. They must now be
enabled in zoo.cfg. When TTL Nodes are enabled, the max
Server ID changes from 255 to 254. This allows the high byte of a session
ID stored in the ephemeral owner to use 0xFF to denote
a TTL node.
commit 63c21e4c57beff5fbb49a44f5ece864eb38016aa
Author: randgalt <[email protected]>
Date: 2017-09-23T14:32:43Z
Enabled ttl nodes in the example zoo.cfg as the cost of doing so is very
low. Including a comment about the different max server id
----
---