Repository navigation
Conversation
Backport the released quota enforcement changes onto branch-3.6: - ZOOKEEPER-3301: hard count/byte quota limits, setquota/delquota -N/-B, extensible StatsTrack format, QuotaExceededException, and the startup-only zookeeper.enforceQuota admission check (default false). - ZOOKEEPER-4219: use the pending change record's data for setData quota checks so create-then-setData multi transactions work. - ZOOKEEPER-4377: report unknown error codes explicitly instead of NPE. Fork-specific: native QUOTAEXCEEDED uses -125 to match upstream, and the fork's TOTALEPHEMERALLIMITEXCEEDED moves to -128 to match the LinkedIn 3.8-based fork. Clients must be migrated before servers. Per-namespace quota metrics (ZOOKEEPER-4211) are intentionally excluded. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Oct 19, 2026
Author
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 the native znode quota enforcement released in Apache ZooKeeper 3.8.7 onto
branch-3.6. Replaces #164 and contains only the following upstream changes plus the fork-specific error-code renumbering:setquota -N/-B,delquota -N/-B), extensibleStatsTrackwire format (old parsers ignore the new fields),QuotaExceededException, and the admission check inPrepRequestProcessorcontrolled by the startup-onlyzookeeper.enforceQuota(defaultfalse).multi.IllegalArgumentExceptioninstead of an NPE.QUOTAEXCEEDED = -125(matches upstream). The fork'sTOTALEPHEMERALLIMITEXCEEDEDmoves from-125to-128, matching the existing LinkedIn 3.8-based fork (Li dev/base 3.8.4 ephemeral change #138). The ephemeral limiter itself is unchanged.Not included: per-namespace quota metrics /
CounterSet/GaugeSetSPI (ZOOKEEPER-4211), Curator compatibility-module changes, and anything beyond released 3.8.7 behavior (no reservation-based strict enforcement).Released 3.8 limitations are preserved: admission uses committed usage, so
multiand pipelined writes can overshoot; deletes are never quota-rejected.Tests
StatsTrackTest,QuotasTest,StringUtilTest,KeeperExceptionQuotaTest,DataTreeTest,ZooKeeperQuotaTest,ZooKeeperQuotaEnforcementTest,QuorumQuotaTest,QuorumQuotaEnforcementTest,EnforceQuotaTest,QuotaClientCompatibilityTest(old/new client in separate JVMs),ZooKeeperTest,MultiOperationTest,PrepRequestProcessorTest,ZooKeeperServerTest,ServerMetricsTest,PathUtilsTest,EphemeralNodeThrottlingTest.test-compileand uncachedcheckstyle:checkpass.Changes that Break Backward Compatibility (Optional)
-125changes meaning. Old fork clients will see quota errors as the ephemeral-limit error, and-128is unknown to them. Migrate clients before rolling servers, even with enforcement disabled.zookeeper.enforceQuota=false(default) now also disables the soft-quota warning log that 3.6 always emitted. Usage accounting continues.StatsTrack.getCount()returnslong;Quotas.quotaPath()returns the quota directory (uselimitPath()for the limit znode);SetQuotaCommand.createQuota/DelQuotaCommand.delQuotatakeStatsTrack;DataTree.updateCountBytes→updateQuotaStat.Documentation (Optional)
Updated
zookeeperQuotas.md,zookeeperCLI.md, andzookeeperAdmin.mdwith the new flags, enforcement semantics, limitations, metadata ACL guidance, client migration matrix, and activation/rollback steps.Created with GitHub Copilot CLI.