Skip to content

P07: Port secure client addresses to ZooKeeper 3.8.7 - #183

Merged
bellatrix007 merged 2 commits into
adbansal/zk-387-p06-ephemeral-budgetfrom
adbansal/zk-387-p07-secure-client-addresses
Dec 3, 2026
Merged

bellatrix007 merged 2 commits into
adbansal/zk-387-p06-ephemeral-budgetfrom
adbansal/zk-387-p07-secure-client-addresses

Conversation

@bellatrix007

Copy link
Copy Markdown

Description

Port #120 (ZOOKEEPER-4276) to 3.8.7, stacked on #182. Quorum entries can advertise a secure client address after a second semicolon:

server.5=host:quorumPort:electionPort;;secureClientPort
server.5=host:quorumPort:electionPort;clientPort;secureClientPort

The secure address participates in serialization, equality, duplicate checks and static/dynamic configuration reconciliation. TLS-only startup does not create a plaintext listener. Reconfiguration can remove or rebind existing listeners. The 3.8.7 adaptation uses getMyId() for own-member lookups; the older port's getId() resolves to the thread ID here.

Known inherited limitation: creating a previously absent listener through an in-place reconfiguration binds the port without attaching the active server. Clients receive connection-loss errors until a subsequent role transition or restart. This port preserves that behavior and documents it; it does not claim that all in-place listener transitions work.

Tests

  • Added/ported secure-address parsing, static/dynamic configuration, TLS-only startup, dual listeners, persistence/restart and listener-reconfiguration cases; adapted carried test lifecycle/assertions to Jupiter.

  • Selected Maven clean verify suite (-pl zookeeper-server -am): 80 cases on each of Java 8, 11 and 17, 240 executions total, with no failures, errors, skips or retries. Each run includes 27 baseline cases plus 53 selected configuration/TLS/client cases.

  • Broader Java 11 regression: 147 initial cases, 141 passed. Two test-isolation errors were corrected and pass in the exact-head matrix. Four IPv6 cases passed separately without the IPv4-only fixture flag. The initial failures are retained, not reported as a clean first run.

  • Java 11 assembly, RAT, Checkstyle and SpotBugs passed. Only documentation changed afterward.

  • Address-grammar probes match the source fork for 16 inputs. Listener-creation probes reproduce the limitation above on both the fork and this port. Full mixed-version rolling-upgrade and production IPv6 qualification remain separate.

  • Local code review completed

Changes that Break Backward Compatibility (Optional)

  • Configuration parsers without this extension, including the checked stock 3.6.3 and 3.8.7 parsers, reject dual/TLS-only entries. Servers and tooling that parse these entries must support them before the format is used. Retrieving raw configuration bytes and ordinary client sessions with explicit connection strings are distinct from parsing this format.
  • AddressTuple requires an additional secure-address constructor argument, and QuorumPeerConfig.editStaticConfig requires an additional flag. The prior five-argument QuorumServer constructor remains available.
  • Inherited behavior retained: parsing secure entries may initialize the default JVM-wide x509 auth-provider property; ConfigUtils.getClientConfigStr still lists plaintext addresses only; extra semicolon sections are not validated consistently.

Documentation (Optional)

Updated zookeeperReconfig.md with secure-address forms, static-setting compatibility, configuration-parser requirements and the inherited in-place listener-creation limitation.

🤖 Generated with GitHub Copilot CLI

@arkmish arkmish left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch is stacked on a stale P06 commit (8150e668ec) instead of current P06 (#182) HEAD (1103109081, which includes CI-fix commit e2eb23564a and rebased P04/P05/P06). As a result:

  • GitHub renders ~6,262 diff lines across 53 files (4,400+ stale lines from earlier PRs) instead of P07's actual ~1,864-line diff.
  • CI (mvn (full-build-java-tests, 11)) is failing on ReadOnlyModeTest.testConnectionEvents (failed job).

Please rebase onto current #182 HEAD so the diff is clean and CI runs with e2eb23564a.

Aditi Bansal and others added 2 commits December 1, 2026 17:57
Port the fork change for ZOOKEEPER-4276 (#120) that
adds an optional secure client address to server.N entries and makes the
plaintext client address optional, e.g.

    server.5=125.23.63.23:1234:1235;;1237

The secure address is parsed, serialized, compared and duplicate-checked
with the other addresses, agrees with secureClientPort/secureClientPortAddress
in the static config, is erased from the static config once it is set
dynamically, and is applied to the secure listener on reconfiguration.
Reconfiguration also shuts down or starts the plaintext listener when its
address is removed or added, and a joiner needs at least one client address.

Adapted to 3.8.7: own-entry lookups use getMyId(), because getId() is
Thread.getId() on this line. Carried tests are converted to JUnit 5 and
focused parsing, configuration, persistence and listener tests are added.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Describe the fork extension without an incorrect upstream version label, distinguish static address fallback from reconfiguration joiner requirements, and disclose the inherited listener-creation limitation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bellatrix007
bellatrix007 force-pushed the adbansal/zk-387-p07-secure-client-addresses branch from 40cdd3b to a476430 Compare December 1, 2026 12:38
@bellatrix007 bellatrix007 added the upgrade-3.8.x Port of LinkedIn patches onto Apache ZooKeeper 3.8.x label Dec 2, 2026

@arkmish arkmish left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for addressing the comments.

@bellatrix007
bellatrix007 merged commit bb96336 into li-dev/base-3.8.7 Dec 3, 2026
27 of 28 checks passed
@bellatrix007
bellatrix007 deleted the adbansal/zk-387-p07-secure-client-addresses branch December 3, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upgrade-3.8.x Port of LinkedIn patches onto Apache ZooKeeper 3.8.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants