Repository navigation
P06: Port per-session ephemeral byte budget to ZooKeeper 3.8.7 - #182
Merged
bellatrix007 merged 4 commits intoDec 3, 2026
Merged
bellatrix007 merged 4 commits into
bellatrix007 merged 4 commits into
Conversation
1 task
bellatrix007
force-pushed
the
adbansal/zk-387-p06-ephemeral-budget
branch
from
November 27, 2026 06:10
3c8f333 to
8150e66
Compare
Adds the opt-in zookeeper.ephemeralNodes.total.byte.limit system property (default -1, disabled). When set, the leader's request preparation rejects an ephemeral create whose serialized full path (4-byte length prefix plus encoded bytes) would push the session's committed total above the limit, logs the rejection, increments ephemeral_node_limit_violation and returns TOTALEPHEMERALLIMITEXCEEDED. DataTree keeps the per-session total on create, delete and close. The check uses committed state only, so concurrent or batched creates can exceed the configured value. The error code is -128 because -125 is QUOTAEXCEEDED in 3.8. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Describe the custom -128 client requirement, the published fork client that recognizes it, and the inherited committed-state and snapshot accounting limitations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bellatrix007
force-pushed
the
adbansal/zk-387-p06-ephemeral-budget
branch
from
November 27, 2026 10:12
8150e66 to
1103109
Compare
arkmish
reviewed
Dec 1, 2026
1 task
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
arkmish
approved these changes
Dec 3, 2026
arkmish
left a comment
There was a problem hiding this comment.
LGTM. Thanks for addressing the comments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Port the per-session ephemeral path-byte budget from #118 and #119 to 3.8.7, stacked on #181.
zookeeper.ephemeralNodes.total.byte.limitlimits the combined Jute-serialized path sizes, including string-length prefixes; the default-1disables it. Rejected creates emit a log entry and incrementephemeral_node_limit_violation.This preserves a best-effort check, not a hard quota. Concurrent requests and creates within one multi can overshoot. Snapshot loading does not rebuild byte totals, and the legacy close-session path without a transaction can retain accounting. These inherited limitations are not redesigned here.
Tests
Added
EphemeralNodeByteLimitTestandBinaryOutputArchiveTest, plus a disabled-mode case inDataTreeTest; ported both ephemeral-throttling test classes to Jupiter.Selected Maven
clean verifysuite (-pl zookeeper-server -am): 239 tests on each of Java 8, 11 and 17, 717 executions total, with no failures, errors, skips or retries. Run on macOS ARM64 with process-local IPv4/RMI loopback settings.Java 11 assembly packaging, RAT, Checkstyle and SpotBugs passed. Only documentation changed after these runs.
The timed concurrency test uses a 32 KiB budget so its existing request window can reach the limit, retaining the 5% tolerance. Its follower assertion now checks the follower session rather than the leader twice.
Matching-client interoperability and accounting probes completed. Older-client decoding failures are disclosed below. The published 3.8.4-0 client JAR was separately checked for error-code decoding, not full interoperability.
Local code review completed
Changes that Break Backward Compatibility (Optional)
The custom
TOTALEPHEMERALLIMITEXCEEDEDcode is-128, not the older fork's-125, because upstream already uses-125forQUOTAEXCEEDED.When this limit is enabled and exceeded, old fork Java clients throw
NullPointerException; an unpatched 3.8.7 Java client throwsIllegalArgumentException. Async callbacks receive raw-128. Conversely, newer clients interpret an old server's-125budget rejection asQuotaExceededException.Keep the budget disabled with incompatible clients. Clients must recognize the custom code before it is enabled;
com.linkedin.zookeeper:zookeeper:3.8.4-0already recognizes it, but an Apache version number alone is not sufficient.Documentation (Optional)
Updated the
ephemeralNodes.total.byte.limitentry inzookeeper-docs/src/main/resources/markdown/zookeeperAdmin.mdwith the setting, best-effort/snapshot limitations and client-compatibility warning.🤖 Generated with GitHub Copilot CLI