Skip to content

Remove test_keeper_ipv4_fallback, which disables IPv6 for the whole integration job - #132156

Merged
antonio2368 merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/remove-test-keeper-ipv4-fallback
Nov 19, 2026
Merged

antonio2368 merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/remove-test-keeper-ipv4-fallback

Conversation

@groeneai

@groeneai groeneai commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #85901

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Not required.

Description

test_grpc_protocol/test.py::test_ipv6_select_one times out opening its gRPC channel over IPv6 (grpc.FutureTimeoutError after 10 s) in Integration tests (arm_binary, distributed plan, targeted): 1, 2, 3. In 30 days it failed in 3 of the 17 runs of that check that also ran test_keeper_ipv4_fallback, and in none of the 553 that did not.

test_keeper_ipv4_fallback runs sysctl -w net.ipv6.conf.all.disable_ipv6=1, then =0, as root in the job container, which is the network namespace of the nested dockerd and of pytest. Disabling IPv6 flushes every IPv6 address there, and the restore brings back only ::1 and link-local addresses, not dockerd's fd00::1/8 on docker0. After that, a connect to a container's IPv6 address made while the gateway of a fresh compose network is still in duplicate address detection picks a link-local source of another interface, the reply cannot reach it, and the connect hangs past the 10 s budget. The targeted job runs test_grpc_protocol in the sequential phase, after the keeper module, and the release arm server is up within that window.

The module also never reaches the IPv4 fallback it covers: [::] still binds with disable_ipv6=1 (the fallback needs socket(AF_INET6) itself to fail, as with the ipv6.disable=1 boot parameter), and the Keeper containers get fresh namespaces that do not inherit the toggle. So I delete it with its two duration-table lines.

Validation: in private network namespaces modelled on the job container, after the toggle docker0 has no fd00::1/8 and a 10 s connect during DAD times out 3/3, versus OK in about 2 s 3/3 before it; [::] binds under disable_ipv6=1. No reference to the module remains, the CI config still imports, and the style check passes.

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/132156]

Version info

  • Merged into: 26.11.1.2863-master (included in 26.11 and later)

…ntegration job

The module runs `sysctl -w net.ipv6.conf.all.disable_ipv6=1`, starts its
cluster, and writes `=0` in `finally`. pytest runs as root in the
integration job container, so this flips IPv6 in the job container's
network namespace, where the nested dockerd's bridges and every pytest
process live.

Disabling IPv6 flushes every IPv6 address in that namespace. The restore
brings back only what the kernel generates (`::1`, link-local
addresses), not dockerd's static `fd00::1/8` on `docker0`
(`fixed-cidr-v6: fd00::/8`), and it also enables IPv6 on the container's
uplink, which Docker had disabled. For the rest of the job the namespace
has no global IPv6 source address except the gateways of the compose
bridges themselves.

The gateway of a new compose network (`2001:3984:3989::1` for
test_grpc_protocol) is added with duplicate address detection, so it is
tentative for 1-2 s. A TCP connect to the container's IPv6 address
issued in that window has to pick another source: before the toggle
that is `fd00::1` and the connection completes as soon as DAD ends;
after the toggle it is a link-local address of another interface (or
`::1`), the container's reply to it cannot be delivered over the bridge,
and the SYN is retransmitted from the same source until the 10 s
`channel_ready_future` budget of `test_ipv6_select_one` runs out.

Only the targeted check is affected: it moves test_grpc_protocol (a
fixed-address module) to the sequential phase, after every parallel
module, so the toggle always precedes it, and the release arm_binary
server is ready within the DAD window. The regular shards run
test_grpc_protocol before the keeper module. CIDB, 30 days, rows of
test_ipv6_select_one:

  arm targeted, keeper module in the same job       3 FAIL / 14 OK
  arm targeted, keeper module not in the job        0 FAIL / 553 OK
  amd sanitizer targeted, keeper module in the job  0 FAIL / 50 OK
  regular arm shards (grpc runs before keeper)      0 FAIL / 7500 OK

Reproduced in private network namespaces modelled on the job container:
a 10 s connect started while the gateway is tentative completes in ~2 s
with source `fd00::1` before the toggle (3/3) and times out with a
`fe80::` source after it (3/3).

The module does not test what it claims. `[::]` still binds with
`disable_ipv6=1`, so NuRaft's IPv6 acceptor never fails and the IPv4
fallback in `KeeperServer::launchRaftServer` is never reached; that
needs `socket(AF_INET6)` itself to fail, as with the `ipv6.disable=1`
boot parameter, which a CI container cannot emulate (the author of
ClickHouse#85901 said so, and its Bugfix validation failed on master). The Keeper
containers get fresh network namespaces that do not inherit the toggle,
and `keeper_ipv6_enabled.xml` is a user config of `node1`, which runs no
Keeper. The module was kept sequential until 511c5a1 made it
parallel.

Drop its line from RAW_TEST_DURATIONS and from the durations sample, as
in 95af852.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 0 findings) plus an independent cold review of the same head (0 blocker, 0 major). Nothing to adjudicate.

Session id: cron:clickhouse-review-slot-10:20261116-220400

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @pamarcos, could you review this? It removes test_keeper_ipv4_fallback: its sysctl disable_ipv6=1/=0 toggle runs in the integration job container and drops dockerd's fd00::1/8 on docker0, so later IPv6 connects (test_grpc_protocol::test_ipv6_select_one in the arm targeted job) time out; the module never reached the IPv4 fallback it covers anyway.

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes, of the failing condition: in private network namespaces modelled on the job container (uplink with IPv6 off, docker0 with fd00::1/8, a fresh bridge with gateway 2001:3984:3989::1 and a peer at 2001:3984:3989::1:1111), a 10 s connect started while the gateway is tentative times out 3/3 after the disable_ipv6=1 / =0 toggle. The end-to-end gRPC run was not attempted: the module, run as root on a shared host, disables IPv6 for the whole host.
b Root cause explained? The toggle flushes every IPv6 address in the job container's namespace and the restore does not bring back fd00::1/8 on docker0. A connect to a container's IPv6 address during DAD of the new bridge gateway then picks a link-local source of another interface, the reply cannot reach it, and the connect outlives the 10 s budget. The targeted job runs test_grpc_protocol after the keeper module.
c Fix matches root cause? Yes: it removes the namespace-wide sysctl write instead of retrying the victim's connect, which also protects every module that runs after it.
d Test intent preserved / new tests added? The deleted module never reached the code it covers: [::] binds under disable_ipv6=1, and the Keeper containers get fresh namespaces that do not inherit the toggle. test_grpc_protocol is unchanged. No new test: CI-only change that removes a test.
e Both directions demonstrated? Probe: TIMEOUT 3/3 with the toggle, OK in about 2 s 3/3 without it. CIDB, 30 days, arm targeted: 3 FAIL / 14 OK when the keeper module ran in the same job, 0 / 553 when it did not.
f Fix is general across code paths? No other integration test module writes network sysctls, ip6tables or ip -6 on the job side, and no disable_ipv6 remains in tests/, ci/ or docker/.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A (no product code).
h Backward compatible? (maintainer-approved exception only) Yes: no setting, format or server behaviour changes; the CI batch packer sees one module fewer.
i Invariants and contracts preserved? A test module no longer changes the job container's network configuration. Both duration tables keep their format, and TEST_DURATIONS still imports (1207 entries).

Session id: cron:clickhouse-impl-slot-4:20261116-215300

@clickhouse-gh

clickhouse-gh Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [2ff5dd8]

Summary: ✅


AI Review

Summary

Removes test_keeper_ipv4_fallback and its two duration entries to eliminate a fixture that modifies the integration job's shared IPv6 configuration. The fixture does not configure the Keeper containers for the intended IPv4 fallback scenario; the original PR discussion also confirms that it passed without the fallback fix. Reviewed the full diff, current code, and all prior discussion at head 2ff5dd8f227109d3ee78154197ea7d91d75cb2dd. No actionable findings. Focused validation passed: both duration tables parse, and all 1,217 discovered integration modules are assigned exactly once across five shards.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added pr-ci can be tested Allows running workflows for external contributors manual approve Manual approve required to run CI comp-testing Test content only (no production code). labels Nov 16, 2026

@clickhouse-gh clickhouse-gh Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI review approves this commit, see the AI Review comment.

@antonio2368 antonio2368 self-assigned this Nov 17, 2026
@antonio2368
antonio2368 added this pull request to the merge queue Nov 19, 2026
Merged via the queue into ClickHouse:master with commit 849afc7 Nov 19, 2026
386 of 387 checks passed
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-testing Test content only (no production code). manual approve Manual approve required to run CI pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants