Skip to content

Cherry pick #115512 to 26.7: Keep the SeaweedFS mini admin gRPC port out of the ephemeral range - #119267

Merged
PedroTadim merged 3 commits into
backport/26.7/115512from
cherrypick/26.7/115512
Sep 10, 2026
Merged

PedroTadim merged 3 commits into
backport/26.7/115512from
cherrypick/26.7/115512

Conversation

@robot-clickhouse-ci-1

Copy link
Copy Markdown
Contributor

Original pull-request #115512

Do not merge this PR manually

This pull-request is a first step of an automated backporting.
It contains changes similar to calling git cherry-pick locally.
If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.

The check results does not matter at this step - you can safely ignore them.

Before you resolve anything

Conflicts are often caused by a prerequisite change that has not been backported yet, rather than by a real divergence. The bot re-tries this cherry-pick against the release branch on every run, so if that is the case here it will merge itself as soon as the prerequisite lands, and you will see a comment saying so. Manual resolution is only needed while the conflict persists.

Troubleshooting

If the conflicts were resolved in a wrong way

If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:

  • delete the pr-cherrypick label from the PR
  • delete this branch from the repository

You also need to check the Original pull-request for pr-backports-created label, and delete if it's presented there

The PR source

The PR is created in the CI job

groeneai and others added 2 commits August 19, 2026 19:14
test_database_iceberg_seaweedfs_catalog could fail during fixture setup with a
Connection refused from wait_for_seaweedfs, which reads as "the Iceberg REST
catalog never started". That reading is wrong: the catalog answered HTTP 200 on
all 314 polls, and the Connection refused was only the final poll, issued after
the container had already exited 255.

weed mini derives its admin gRPC port as admin.port + 10000, i.e. 23646 + 10000
= 33646, which is inside the Linux ephemeral range (floor 32768). One of mini's
own startup dials can therefore take 33646 as an outbound source port before the
admin server binds it, and the listen fails with "bind: address already in use"
(mini.go:1583). Admin is the only derived gRPC port above the floor: mini derives
exactly five of them (master 19333, filer 18888, volume 19340, s3 18333, admin
33646), and WebDAV and Iceberg carry a null gRPC pointer so they derive nothing.

The failure then masks itself. glog.Fatalf (mini.go:1598) skips
defer close(allServicesReady), and ensureMiniTableBuckets, which creates
-tableBucket=analytics, runs only after <-allServicesReady. So the Iceberg
service keeps answering 200 while the analytics bucket is never created, and the
fixture's "analytics" in buckets condition can never become true.

Pinning -admin.port=12646 makes the derived port 22646: below the ephemeral
floor, and below the 22768 cap SeaweedFS uses for this same problem in its own
test port allocator (seaweedfs/seaweedfs#10209, which left the mini default
alone). The default is still 23646 on tags 4.41, 4.42 and upstream master, so
bumping the image does not help. -admin.ui=false does not help either:
startMiniAdminWithWorker is launched unconditionally and miniEnableAdminUI only
affects the welcome banner. Extending the fixture wait cannot help, because the
container is dead and the bucket is never created.

Validated by forcing the collision with
docker run --sysctl net.ipv4.ip_local_port_range="33646 33646" on
chrislusf/seaweedfs:4.41: without the pin the CI log reproduces verbatim at both
mini.go:1583 and mini.go:1598 including the two-minute readiness gap, and the
analytics bucket is never created; with the pin it is. A control run on the
default range passes unpinned, so the harness is not trivially red. The
integration test itself passes and its container log reports
Admin UI: ...:12646, where the same run on unpinned master reports ...:23646.

The other SeaweedFS entry point, ci/jobs/scripts/functional_tests/
setup_seaweedfs.sh, needs no change: it runs weed server, which has no admin
server, and already pins ports deriving to 21111..21114.

The same collision reaches users through the two documented setups, so they are
pinned as well: the SeaweedFS catalog guide's docker-compose.yml and the
SeaweedFS connector page's docker run. Both pin image :latest, and admin.port is
still 23646 there. Their symptom is worse than the test's, because the bucket
each page tells the reader to use is the one that is never created, while the
container keeps answering HTTP 200: the guide's CREATE DATABASE against
s3://analytics and the connector page's clickhouse bucket both fail against a
container that looks healthy. Verified on chrislusf/seaweedfs:latest with the
same forced collision, once per page: unpinned, neither "created bucket
clickhouse" nor "created table bucket analytics" appears and the container exits
255; pinned, each bucket is created and the container reports
Admin UI: ...:12646. Both snippets keep publishing only 8333 and 8181, so the
pinned admin port stays inside the container.

The eight locale copies of the guide are left alone: they are generated from the
English source (docs/README.md), so editing them by hand would be overwritten.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109368&sha=4443610796f2ef985ff5615a261456a7ea4155ea&name_0=PR&name_1=Integration%20tests%20%28amd_tsan%2C%205%2F6%29
Related: #109368
Upstream: seaweedfs/seaweedfs#10838
…t-ephemeral

Keep the SeaweedFS mini admin gRPC port out of the ephemeral range
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! do not test disable testing on pull request labels Sep 10, 2026
@PedroTadim

Copy link
Copy Markdown
Member

Closing as not the real solution to fix the flakiness

@PedroTadim PedroTadim closed this Sep 10, 2026
@PedroTadim PedroTadim reopened this Sep 10, 2026
@PedroTadim

Copy link
Copy Markdown
Member

Still worth to backport

…out of the ephemeral range

Conflict resolution: the two .mdx documentation files touched by the original
PR do not exist on the 26.7 release branch, so only the compose-file change
(pinning -admin.port=12646) is backported.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@PedroTadim
PedroTadim merged commit 3640704 into backport/26.7/115512 Sep 10, 2026
1 check passed
@PedroTadim
PedroTadim deleted the cherrypick/26.7/115512 branch September 10, 2026 16:16
@clickhouse-gh clickhouse-gh Bot added the external Author is not a member of the ClickHouse organization label Sep 11, 2026
@maxknv maxknv removed the external Author is not a member of the ClickHouse organization label Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not test disable testing on pull request pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants