Skip to content

ZOOKEEPER-4219: Quota checks break setData in multi transactions (backport) - #167

Merged
arkmish merged 1 commit into
armishra/zookeeper-3301-quota-enforcementfrom
armishra/zookeeper-4219-quota-multi-setdata
Oct 19, 2026
Merged

arkmish merged 1 commit into
armishra/zookeeper-3301-quota-enforcementfrom
armishra/zookeeper-4219-quota-multi-setdata

Conversation

@arkmish

@arkmish arkmish commented Oct 19, 2026

Copy link
Copy Markdown

Description

Stack 2/3: mirrors upstream ZOOKEEPER-4219 (apache/zookeeper@eb1569e4f, released in 3.7.0 / 3.8.0). This PR is based on the ZOOKEEPER-3301 PR, so merge that first.

checkQuota used to look up the node's existing data in DataTree. For a multi() that creates a node and then sets its data, the node exists only as a pending ChangeRecord, so that lookup threw an NPE. The fix passes nodeRecord.data from PrepRequestProcessor into checkQuota(path, lastData, data, type); create passes null.

Tests

  • ZooKeeperQuotaEnforcementTest covers both cases:
    • An admissible create-then-setData multi succeeds.
    • An over-quota multi returns QuotaExceededException and leaves no partial changes.
  • Local run of 16 suites: 172 tests passed. Checkstyle passed.

Changes that Break Backward Compatibility (Optional)

The signature of the public ZooKeeperServer.checkQuota method changes, as it did upstream.

Documentation (Optional)

Updated the JIRA list in zookeeperQuotas.md.

  • Local code review completed

Created with GitHub Copilot CLI.

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>
@arkmish
arkmish merged commit 1e2b5f7 into armishra/zookeeper-3301-quota-enforcement Oct 19, 2026
16 checks passed
@arkmish
arkmish deleted the armishra/zookeeper-4219-quota-multi-setdata branch October 19, 2026 14:53
@arkmish

arkmish commented Oct 19, 2026

Copy link
Copy Markdown
Author

Folded into #166, which now carries all three backport commits. This PR shows as merged only because its commits became part of the stacked base branch; nothing was merged into branch-3.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant