Repository navigation
Add a test for default_session_user naming a user that is not declared in the users configuration - #117386
Conversation
…d in the users configuration `default_session_user` substitutes a configured user name whenever a client connects without one. Its integration suite covered the setting naming a declared user on every interface, and the empty-string reject mode on every interface, but not the value naming a user that is absent from the users configuration: the ordinary typo, and the state a server is in whenever the shipped default `default` is used while the `default` user has been removed from the users configuration. The one existing nonexistent-user assertion supplies the name from the client in the native Hello, so no substitution happens on that path and the setting is not exercised. Nothing validates the name earlier. The only config-time check on the setting concerns the interserver protocol, so the server starts normally and the failure is deferred to connect time: the name is substituted for the empty user name and then authenticated like any other, and `AccessControl::authenticate` reports `AUTHENTICATION_FAILED` under the configured name, which HTTP answers with 403. That is the setting's own documented contract, an empty user name being merely an alias for the configured user name, so the connection stays subject to the substituted user's authentication. The test points the global `default_session_user` of the module's otherwise-idle `node2` at a name absent from `configs/users.xml` and makes one anonymous HTTP request plus one explicit-user control. `node2` no longer mounts `configs/config.xml`, whose endpoints nothing on that node uses; it keeps the cluster definition the interserver test needs and the reload-interval pin the fixture asserts. Requested by @ fm4v in ClickHouse#110179 (comment) Co-Authored-By: Claude Opus 5 <[email protected]>
Internal review record (independent cold review + second-model gate, 0 blockers)Kept short on purpose. No code change came out of it; the four accepted findings were all in the
Independently verified while reviewing, rather than taken from the change: The second-model gate read both changed files, the whole module, the sibling configs, every |
|
Workflow [PR], commit [21065be] Summary: ❌
AI ReviewSummaryThis test-only PR adds an integration case for a global Missing context / blind spots
Final Verdict✅ No new findings. |
|
cc @CheSema, could you review this? It is a test-only change covering the missing case where the |
CI finish ledger -
|
| Check / test | Reason | Owner / fixing PR |
|---|---|---|
Integration tests (amd_asan_ubsan, db disk, old analyzer, 6/6) / Container memory budget exceeded (/docker) |
host memory over-commit: the /docker cgroup leaf OOM-kills the nested containers and the whole shard loses its signal (244 PRs, 305 runs, 25 true-master hits in 7d) |
a fix task owns it at P1 (fixing PR link to follow here) |
This is the only red and it is not caused by this PR. #117202 (merged) is already on this branch and the signature still fires, so ownership stays with the fix task.
Session id: cron:our-pr-ci-monitor:20260901-003000
…ault-session-user
CI finish ledger -
|
| Check / test | Reason | Owner / fixing PR |
|---|---|---|
Integration tests (amd_asan_ubsan, db disk, old analyzer, 6/6) / Container memory budget exceeded (/docker) |
the shard's nested containers breach the /docker cgroup leaf, the kernel OOM-kills processes inside it and the job errors with no test attributed |
#117412 (external, merged 2026-09-01T11:31:33Z) |
The /docker breach is a job-level condition, not a test result. I measured #117412 ABSENT from the tree that ran, from the job's own environment rather than from git ancestry: this job was launched with CI_DIND_INIT_RESERVE=17179869184 (the 16 GiB share #117412 replaces), and so were all ten failing legs I read this tick. The probe discriminates, with a positive control: two shards launched at 14:53Z and 14:59Z carry CI_DIND_INIT_RESERVE=8589934592 (the flat 8 GiB reserve #117412 introduces) and both passed. So this is rule 3c and not rule 3d, and #117411 is not a co-owner: it was closed unmerged at 11:11:48Z in favour of #117412, whose own diff comment states the causal link.
This is the only non-OK, non-SKIPPED node at this head: the praktika report is 32 OK, 137 SKIPPED and this one job's 2 ERROR nodes, and the module this PR adds a test for is not in that shard.
I have not merged master to pick #117412 up, and the reason here is ownership rather than cost: the head commit 21065bec651a of this branch was authored and committed by @ PedroTadim at 2026-09-01T07:37:42Z, merging origin/master into it. Pushing my own master merge on top would collide with work someone else is doing on the branch, so I am leaving the pickup to whoever is driving it.
Mergeable Check reports Failed: Integration tests (amd_asan_ubsan, db disk, old analyzer, 6/6) at this head, which counts only the jobs it gates on. The table above is the complete non-OK, non-SKIPPED node set of the head's praktika report, so it also covers the rows Mergeable Check does not gate.
CH Inc sync was success at this head.
Session id: cron:our-pr-ci-monitor:20260901-163000
fca8bfb
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Related: #110179
Requested by @ fm4v: #110179 (comment)
tests/integration/test_default_session_user/covered the setting naming a declared user, and theempty-string reject mode, on every interface, but not a value naming a user absent from the users
configuration. The one existing nonexistent-user assertion, in
test_native_default_session_user,takes the name from the client in the native Hello, so nothing is substituted there and the setting
is not exercised.
Behaviour. The name is resolved through
AccessControl, which also serves users created by SQL,so a name absent from the users configuration is not necessarily invalid and is not checked at
configuration load; the only config-time check on the setting concerns the interserver protocol.
The server therefore starts, and the failure is deferred to connect time: the name is substituted for
the empty user name and then authenticated like any other, and
AccessControl::authenticatereportsAUTHENTICATION_FAILEDunder the configured name, which HTTP answers with 403. That is the setting'sdocumented contract, an empty user name being merely an alias for the configured user name.
Change. The module's otherwise-idle
node2gets a globaldefault_session_usernaming a userabsent from
configs/users.xml, and one test makes one anonymous HTTP request to it plus oneexplicit-user control.
node2stops mountingconfigs/config.xml, whose endpoints nothing on thatnode uses, keeping the cluster definition and the reload-interval pin its other two assertions need.
Validation. New test 20/20, full module 30/30. Pointing the setting at a declared user fails the
test, since the anonymous request then succeeds; pointing it at a different undeclared name fails the
name assertion while the 403 still holds, so the test pins the substituted name rather than merely
some authentication error.
The other interfaces reach the same failure through their own substitution sites and differ only in
how they report it, which is pre-existing and out of scope here.
Workflow [PR]
Sync PR [sync-upstream/pr/117386]
Version info
26.9.1.494(included in26.9and later)