Skip to content

ZOOKEEPER-5069: Add AdminServer command to query watch registration details#2426

Open
hedong1123 wants to merge 2 commits into
apache:masterfrom
hedong1123:ZOOKEEPER-5069
Open

ZOOKEEPER-5069: Add AdminServer command to query watch registration details#2426
hedong1123 wants to merge 2 commits into
apache:masterfrom
hedong1123:ZOOKEEPER-5069

Conversation

@hedong1123

Copy link
Copy Markdown

Motivation

The existing watches, watches_by_path, and watch_summary AdminServer
commands do not provide per-Watch details correlated with current client
connection information. This makes Watch registration diagnostics difficult.

Changes

  • Add the read-only AdminServer command watch_details and the four-letter
    command alias wchd.
  • Support exact path, session_id, and client_ip filters, plus a limit
    parameter with a default of 100 and a maximum of 1000.
  • Return local Watch registrations only; results are not aggregated across the
    ZooKeeper ensemble.
  • Return client connection details, including Session ID, client IP and port,
    connection establishment time, session timeout, and TLS state.
  • Return watch_kind as an ordered array of event coverage:
    ["data"], ["children"], or ["data", "children"].
  • Aggregate registrations by path + session_id + watch_mode, so Data and
    Children Watches for the same Standard Watch context are returned as one
    entry.
  • Support Standard, Persistent, and Persistent Recursive Watch modes.
  • Apply the result limit after aggregation and report truncation with
    returned_count and truncated.
  • Preserve binary compatibility for third-party IWatchManager
    implementations through a default interface method.
  • Do not add command-specific AdminServer authentication or ACL restrictions.

@hedong1123 hedong1123 closed this Jul 20, 2026
@hedong1123 hedong1123 reopened this Jul 20, 2026
@hedong1123

Copy link
Copy Markdown
Author

The Jenkins failure is unrelated to this PR. It is a timeout in
ZooKeeperServerClusterMutualAuthTest.testStart while waiting for Leader election.

The watch_details-related tests passed, and the failing test passed when rerun
individually with -Dsurefire-forkcount=4. Re-triggering the pre-commit check.

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