forked from empear-analytics/zookeeper
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ZOOKEEPER-4219: Quota checks break setData in multi transactions
Without this patch, a multi() transaction such as the one implemented in ZooKeeperQuotaTest.testMultiCreateThenSetDataShouldWork fails with MarshallingError when 'enforceQuota' is enabled. This happens whenever the node has an associated quota, whether it was exceeded or not. This is due to the server encountering null while trying to access a database node by path--whereas that node only exists as a ChangeRecord in the server's 'outstandingChanges' list: java.lang.NullPointerException at org.apache.zookeeper.server.ZooKeeperServer.checkQuota(ZooKeeperServer.java:2048) at org.apache.zookeeper.server.PrepRequestProcessor.pRequest2Txn(PrepRequestProcessor.java:397) The patch adds an additional 'lastData' parameter to the quota checking function, and passes the data from the ChangeRecord during 'setData' operations. Author: Damien Diederen <[email protected]> Reviewers: Enrico Olivelli <[email protected]>, Mate Szalay-Beko <[email protected]>, Norbert Kalmar <[email protected]> Closes apache#1611 from ztzg/ZOOKEEPER-4219-quota-multi-setdata
- Loading branch information
1 parent
6aa3d42
commit 917071d
Showing
3 changed files
with
59 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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