Repository navigation
Cherry pick #117284 to 26.8: Move the async distributed INSERT directory name test to the integration suite - #117762
Merged
Merged
Conversation
04725_distributed_async_insert_long_directory_name needs an async distributed
INSERT directory name longer than NAME_MAX. It produced that length by making
the destination host 242-250 bytes long, which cannot resolve.
In the upgrade check every DROP is a no-op (tests/clickhouse-test adds
--fake-drop whenever --upgrade-check is set), so the four Remote tables survive
into the post-upgrade server. Attaching ENGINE = Remote builds a Cluster
unconditionally, which resolves each address; the failure is swallowed but
logged through tryLogCurrentException("Cluster") at Error priority. The
post-upgrade log scan then reports four unallowlisted lines:
<Error> Cluster: Code: 198. DB::NetException: Not found address of host: ...
Keep the destination addresses as IPv4 literals, which return from
resolveIPAddressImpl before hostByName is ever called, and carry the required
length in the user name instead: it is equally part of the directory name built
by Cluster::Address::toFullString and equally settable from Remote() DDL. One
shared 233-byte user with 127.0.0.10 / 127.0.0.100 / 127.0.0.1 reproduces the
same four name lengths (255 accepted, 256 rejected, 254 plus 256, 268), so every
assertion and the whole .reference stay byte-identical.
at_limit and over_limit share that user and differ by exactly one escaped host
byte, so the pair is a two-sided pin: a one-byte drift in the user literal makes
one of them fail. Both boundaries were re-checked by mutating the NAME_MAX
predicate one byte in each direction; the test reddens for both.
The fixture rewrite in this PR removes the unresolvable hostnames from 04725 on master, but the upgrade check does not run the tests from the tree under test. upgrade_runner.sh clones the previous release by its tag (--branch=$previous_release_tag) and runs clickhouse-test --queries="previous_release_repository/tests/queries", so the 04725 that executes is the copy frozen inside v26.8.1.2041-lts. That tag is immutable, so neither this PR nor a backport of it can change the test the check actually runs; the fixture fix only takes effect once a newer release becomes the previous release. The log scan, by contrast, comes from the tree under test (stress_job.py sets run_script to /repo/tests/docker_scripts/upgrade_runner.sh), so an exclusion added here takes effect immediately, for every tree that carries it. The exclusion requires the Cluster logger, Code: 198, and a first host label of 64 or more identical characters. That is past the 63 octets RFC 1035 permits a label, and the repeated-character shape is not one any deployment uses, so a genuine post-upgrade failure to resolve a cluster peer still fails this job. Matching the repeated run rather than the letters keeps the entry off the specific literals: tests/ spells the same fixture idiom with c and x runs elsewhere. Measured against the scanner extracted from this file and the log lines of eight real carrier runs: 32 of 32 fixture lines are excluded, the 96 unrelated mutation-class lines in the same set are untouched, and 7 of the 8 carriers produce an empty upgrade_error_messages.txt (the eighth keeps only those mutation-class lines). Widening the threshold, dropping the repeated-run requirement, or corrupting either anchor all change the result, and hosts that merely look unusual stay visible: a 68-character label that is not a repeated run, a label of two 40-character runs, a 63-character run, and the same run reported by a different logger. This supersedes my earlier reply on this PR declining an allowlist entry. That reply argued against masking Cluster:.*Not found address of host as a class, which would indeed hide real peer-resolution failures. That is still the wrong entry and it is not this one. The reply was also written on the assumption that the fixture fix would reach the check, which the tag measurement above refutes.
…ation suite The limit applies to the whole spool directory name, `user[:password]@host:port#default_database`, so `04725_distributed_async_insert_long_directory_name` had to take its length from a field a stateless test can lengthen. `Cluster::Address::default_database` is only ever assigned from `<remote_servers>` (`Cluster.cpp:122`), and the `Address` constructor that `Remote()` and `remote()` reach never sets it, so the test used the host rather than the database name of the reproducer in #112719. Remove that test and cover a long `default_database` in `test_distributed_format`, beside the two cases already there. The new case keeps the assertions only the stateless test had: 255 bytes accepted and 256 rejected, the message not disclosing the password, and the compact format unaffected. All three are pinned by the length the message reports, and each of the three fixture clusters was mutated by one byte, or by dropping the password, to confirm the test reddens. Its remaining assertion, that a destination rejected for being too long leaves no directory behind for an earlier and shorter destination of the same shard, moves into the mixed-cluster test: with `prefer_localhost_replica = 0` that shard queues two destinations instead of writing locally. The compact-format INSERT that follows queues exactly two directories for the same table, so the zero above is measured rather than assumed. The upgrade log-scan entry stays for now: that job clones the previous release's suite by tag, so the removed test still runs there.
Move the async distributed INSERT directory name test to the integration suite
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.
Original pull-request #117284
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-picklocally.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.
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:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job