Repository navigation
P05: Port paginated getChildren to ZooKeeper 3.8.7 - #181
Merged
bellatrix007 merged 1 commit intoDec 3, 2026
Merged
Conversation
1 task
1 task
arkmish
reviewed
Nov 25, 2026
bellatrix007
force-pushed
the
adbansal/zk-387-p05-pagination
branch
from
November 27, 2026 06:10
fc94a29 to
b8901ce
Compare
Add the paginated getChildren operation (opcode 71) with its Jute request/response records, the client page, list-all and iterator APIs, server dispatch with READ authorization, and the DataTree implementation ordered by (czxid, name) with buffer-bounded pages, including the root-path lookup fix. Adapt to 3.8.7: use the target checkACL form used by getChildren2, the target default-watcher helper for the boolean watch overload, and Jupiter tests. Add focused tests for page boundaries, large child sets, READ denial, chroot, concurrent mutation and reconnect watch behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bellatrix007
force-pushed
the
adbansal/zk-387-p05-pagination
branch
from
November 27, 2026 10:12
b8901ce to
70a43de
Compare
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 P05 above #180: the paginated
getChildrenoperation.branch-3.6(9d245933): Cherry-pick and adapt ZOOKEEPER-2260 for getChildren pagination #5 (2736f44a), Optimize paginated getChildren #8 (1d95c2ea) and the root-path fix Fix paginated getChildren returning no children for the root path #160 (d7d56cf3), reconciled with the 3.8.4 port (Optimize paginated getChildren #136).getChildrenPaginated(71), Jute recordsGetChildrenPaginatedRequest,GetChildrenPaginatedResponseandPathWithStat, andZooDefs.GetChildrenPaginatedlast-page markers (-1,-1).getChildren(path, watcher, maxReturned, minCzxId, czxidOffset, stat, nextPage),getAllChildrenPaginated(path, watch),getChildrenIterator(path, watcher, batchSize, minCzxId),PaginationNextPageandRemoteIterator.(czxid, name)and bounded bymaxReturnedand the serverjute.maxbuffer. Continuation is(nextPageCzxid, nextPageCzxidOffset). The parent READ ACL is checked before any children are read or a watch is added, as forgetChildren2. The child watch is set only when the last page is returned. Root and chroot paths are supported.checkACLform used bygetChildren2, the target default-watcher helper for the booleanwatchoverload, and JUnit 5 tests. ExistinggetChildren/getChildren2, records and opcodes are unchanged.Inherited limitations (unchanged from the source):
getAllChildrenPaginateddetects this case, but its overlap re-read has no empty-page guard.jute.maxbufferthan the server can still reject a page.Tests
GetChildrenPaginatedTest(17) and fourDataTreeTestpagination cases. They cover page boundaries, czxid groups and offsets, large child sets, READ denial, root, chroot, concurrent mutation and watch re-registration after reconnect.branch-3.6fork client built from source passed 11/11 pagination checks against this server on JDK 8/11/17. Generated record encodings are byte-identical. A stock 3.6.3 server repliesUNIMPLEMENTEDto opcode 71 and closes the connection; the session continues after reconnect.clean verifyatfc94a294passed 146 tests per JDK (8/11/17), 438 total, with no failures, errors or skips: 27 baseline + 21 new P05 cases + 98 existing chroot, watcher, request-processor, metrics, serialization and X509/ACL regression cases.-Djava.net.preferIPv4Stack=true. The first Java 17 run had five errors in the JMX test harness: RMI stubs advertised the host name's resolved address, which was not reachable locally after a network change. The Java 17 run was repeated with process-local-Djava.rmi.server.hostname=127.0.0.1and passed. JDK 8/11 passed without it. IPv6 remains unqualified. Testing was local macOS ARM64 only, without full-suite, Linux or mixed-version ensemble qualification.Changes that Break Backward Compatibility (Optional)
Existing wire records and opcodes are unchanged. The new APIs require a server that supports opcode 71. A server without it replies
UNIMPLEMENTEDand closes the connection, so callers see an error and a reconnect. During a rolling upgrade, use pagination only once every server a client can connect to supports it. Opcode 71 is not used by upstream 3.8.7.Client watcher behavior follows Apache 3.8.7: construction with a null default watcher is allowed, but
getAllChildrenPaginated(path, true)requires a non-null default watcher and throwsIllegalStateExceptionbefore issuing the request if none is registered. The old fork rejected a null watcher during construction withIllegalArgumentException. Calls withwatch=falsedo not require a default watcher.Documentation (Optional)
Javadoc on the new
ZooKeepermethods,PaginationNextPageandRemoteIterator. No user guide changes.🤖 Generated with GitHub Copilot CLI