zookeeper icon indicating copy to clipboard operation
zookeeper copied to clipboard

ZOOKEEPER-4306: Avoid `CloseSessionTxn`s larger than `jute.maxbuffer`

Open ztzg opened this issue 3 years ago • 7 comments

Allowing a serialized CloseSessionTxn to grow larger than jute.maxbuffer is a really bad idea: not only does it quickly makes the target ensemble unavailable, it even prevents it from restarting.

Such availability issues have been reported or fixed in the past, notably in ZOOKEEPER-2101 and ZOOKEEPER-3496. This one is a bit different because of the "distance" between the cause and its effect.

The size of a CloseSessionTxn transaction is directly related to the total length of the paths of the ephemeral nodes belonging to the session to be closed. That "mass" of data can be built incrementally, across many requests; it is not that difficult for a small "leak" to push the transaction size over jute.maxbuffer if a session lasts long enough.

This series adds serialization size bookkeeping to the per-session ephemeral node management, and fails ephemeral node creation requests which would potentially result in an "overflowing" CloseSessionTxn.

ztzg avatar Jun 17 '21 18:06 ztzg