Repository navigation
Conversation
Backport of apache/zookeeper 190a227 (released in 3.7.0/3.8.0), adapted to branch-3.6. Adds hard count/byte quotas (setquota -N/-B, delquota -N/-B, listquota), the extensible StatsTrack format, QuotaExceededException, and pre-transaction quota checks in PrepRequestProcessor gated by -Dzookeeper.enforceQuota (default false). Fork-specific: native QUOTAEXCEEDED takes -125 (upstream value), so the fork's TotalEphemeralLimitExceeded moves from -125 to -128, matching the existing LinkedIn 3.8 mapping (#138). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Backport of apache/zookeeper eb1569e (released in 3.7.0/3.8.0). checkQuota now receives the previous data from the prepared ChangeRecord instead of looking the node up in DataTree, which NPE'd for a create followed by setData in the same multi(). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…low version client requests the high version server Backport of apache/zookeeper 9f355f5 (released in 3.5.10/3.7.1/3.8.0). Code.get throws IllegalArgumentException for unknown codes and KeeperException.create reports the code, instead of an NPE. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 task
This was referenced Oct 19, 2026
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
Backports native znode quota enforcement from upstream ZooKeeper (released in 3.7/3.8) to
branch-3.6. The PR has one commit per upstream change, in upstream merge order:ChangeRecord, so amulti()that creates a node and then sets its data works correctlyIllegalArgumentExceptioninstead of an NPE inKeeperException.create. This matters for older clients that receive the new-128code.Today
branch-3.6has only soft quotas, which log a WARN and never block a write. This PR adds:setquota -N <count>/-B <bytes>, with matchingdelquota -N/-Band extendedlistquotaoutput.StatsTrackformat that the legacy parser can still read.PrepRequestProcessorfor create and setData; deletes are never rejected.QuotaExceededException(-125).-Dzookeeper.enforceQuota, defaultfalse. As in upstream 3.8, the soft-limit warning also moves behind this flag.Fork-specific:
QUOTAEXCEEDEDtakes upstream's-125, soTotalEphemeralLimitExceededmoves to-128. This is the same mapping as our 3.8 branch (#138). Upgrade clients before servers, because-125changes meaning.Per-namespace quota metrics (ZOOKEEPER-4211) are not included.
Supersedes #165. #167 and #168 were folded into this PR.
Tests
StatsTrackTest,QuotasTest,KeeperExceptionQuotaTest,ZooKeeperQuotaEnforcementTest(including the multi cases),QuorumQuotaEnforcementTest,EnforceQuotaTest, andQuotaClientCompatibilityTest(old and new client JVMs).ZooKeeperQuotaTest,QuorumQuotaTest,DataTreeTest,StringUtilTest.test-compilepass. Each commit also builds and passes the suites on its own.Changes that Break Backward Compatibility (Optional)
TotalEphemeralLimitExceededchanges from-125to-128.StatsTrackcount is nowlong.Quotas.quotaPath()returns the quota directory; uselimitPath()for the limits node.KeeperException.Code.getthrowsIllegalArgumentExceptionfor unknown codes instead of returningnull.Documentation (Optional)
Updated
zookeeperQuotas.md,zookeeperCLI.mdandzookeeperAdmin.md. Overview: ZooKeeper Znode QuotasCreated with GitHub Copilot CLI.