Skip to content

Antalya 26.8 Backport of #125443 - Skip already present authentication methods in ALTER USER ... ADD IDENTIFIED WITH - #2681

Merged
zvonand merged 3 commits into
antalya-26.8from
backports/antalya-26.8/125443
Oct 26, 2026
Merged

zvonand merged 3 commits into
antalya-26.8from
backports/antalya-26.8/125443

Conversation

@zvonand

@zvonand zvonand commented Oct 25, 2026

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

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

ALTER USER ... ADD IDENTIFIED WITH no longer duplicates methods the user already has. Does not apply to passwords with a random salt (sha256_password, scram_sha256_password, bcrypt_password). Side effect: TOTP secret changes in the users config now apply on reload. (ClickHouse#125443 by @zvonand)

Documentation entry for user-facing changes

...

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Unit tests
  • Performance tests
  • Aarch64 tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • CAS (content-addressed storage; Antalya only)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • OAuth (5m)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

alexey-milovidov and others added 2 commits October 25, 2026 17:37
…re-duplicates

Skip already present authentication methods in `ALTER USER ... ADD IDENTIFIED WITH`

Conflicts committed as-is; the next commit resolves them:
- src/Access/AuthenticationData.cpp (both modified)
- src/Interpreters/Access/InterpreterCreateUserQuery.cpp (both modified)
Kept only the PR's de-duplication of auth methods and left out the expired-method pruning code, which comes from a newer upstream change and relies on code 26.8 doesn't have.
@zvonand

zvonand commented Oct 25, 2026

Copy link
Copy Markdown
Member Author

Backporter: cherry-pick conflicts resolved by AI

Conflicted files:

  • src/Access/AuthenticationData.cpp (both modified)
  • src/Interpreters/Access/InterpreterCreateUserQuery.cpp (both modified)

Commits:

  • 25d1444: cherry-pick with the conflicts committed as-is

  • dbeb0cd: resolution

  • src/Access/AuthenticationData.cpp: the conflict was only on the return line of operator==, because antalya-26.8 has a comment about JWT fields there. I kept that comment and added the PR's otp_secret comparison; the salt comparison applied cleanly.

  • src/Interpreters/Access/InterpreterCreateUserQuery.cpp: the incoming side also contained the upstream code that drops expired methods. It isn't part of this PR, uses current_time, which doesn't exist in this function on 26.8, and was left out.

  • From that hunk I kept two things: setting the user-level VALID UNTIL on the methods the user already has, and the PR's loop that removes an existing equal method before appending the new one. The VALID UNTIL part is needed because the PR deletes the later loop that used to do it.

  • The method-count limit now counts the merged list, as in the PR.

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Workflow [PR], commit [a585ea0]

Replaced `{CLICKHOUSE_DATABASE:Identifier}` user names, which antalya-26.8's parser doesn't support, with a fixed `user_05366` name in the new test.
@zvonand

zvonand commented Oct 26, 2026

Copy link
Copy Markdown
Member Author

@blau-ai

@blau-ai

blau-ai commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

CI triage — @zvonand

Verdict: 6 red checks, 0 caused by this PR's code. The only PR-attributable item is a DCO sign-off on the merge commit (a metadata fix, not a code problem); the integration/regression reds are all pre-existing/infra/flaky in code paths this backport never touches. The PR's own tests are green (new stateless 05366, Fast test 11433 passed, stateless amd_debug 13572 passed).

Reminder of the scope: this backport only changes authentication-method handling — ALTER USER … ADD IDENTIFIED WITH de-duplication and the AuthenticationData::operator== (adds otp_secret/salt). It does not touch grants/privileges, OAuth/JWT, iceberg, or distributed/swarm code.


1. DCO — ⚠️ PR-related (process, trivial)

There is one commit incorrectly signed off… 🔴 25d1444 Merge pull request #125443 from zvonand/… — Sign-off not found

Only the upstream merge commit that got pulled into the branch lacks a Signed-off-by: line (your two own commits pass). Fix: add a sign-off to that commit — e.g. rebase and git commit --amend -s on it (or squash the three commits into one signed commit), then push. I can't do this for you: it needs a history rewrite + force-push, which is outside my permissions on your branch.

2. Integration tests (amd_asan_ubsan, db disk, old analyzer, 5/8) — ❌ NOT PR-related (environment/grants)

All 21 failures are in a single file, test_storage_iceberg_with_spark/test_export_partition_iceberg.py, and every one dies at table setup with the same error:

Code: 497. DB::Exception: default: Not enough privileges. To execute this query,
it's necessary to have the grant SHOW NAMED COLLECTIONS SECRETS ON s3.

This is a grant that the default user in the test environment is missing — a privilege-system/test-config issue in the Antalya iceberg-export tests. This PR changes authentication methods only and cannot add or remove grants, so it cannot produce this. Pre-existing on antalya-26.8. Next step: safe to ignore for this PR; the iceberg-export test's named-collection grant setup needs fixing separately.

3. Integration tests (amd_asan_ubsan, db disk, old analyzer, 8/8) — ❌ NOT PR-related (infra)

The shard ERRORed before running any test (0 tests executed). It died in the job harness at the binary smoke-check:

File ".../ci/jobs/integration_test_job.py", line 1137, in main
    Shell.check(f"{clickhouse_path} --version", …, strict=True)
RuntimeError: command failed, exit code …

The builds are all green, so the binary itself is fine — the runner just failed to exec clickhouse --version (runner/environment hiccup). Next step: re-run this shard. Note: because it never ran, re-running also gives the auth integration tests full coverage in case any live in shard 8.

4. Regression release / OAuth (RegressionTestsRelease / OAuth / oauth) — ❌ NOT PR-related (flaky/infra)

9 failed scenarios in the OAuth/JWT external-identity suite, with very heavy retry churn (1814 retries, 298 failed) — the signature of a flaky external identity-provider/container dependency. This suite exercises JWT/token auth against an external provider, a different code path from ADD IDENTIFIED WITH de-dup. Next step: safe to re-run.

5. Regression release / Swarms (RegressionTestsRelease / Swarms / swarms) — ❌ NOT PR-related (flaky/infra)

3 failed scenarios, in node failure / cpu overload and cluster discovery / check cluster discovery with wrong cluster name — distributed swarm-cluster behaviour (CPU-overload simulation, discovery timing), unrelated to access control. Next step: safe to re-run.

6. PR (aggregate gate) — red only because of the above; no independent failure.


Bottom line: nothing in the diff needs a code change. Sign off the merge commit (#1) to clear DCO, and re-run checks #3/#4/#5 (infra/flaky). The iceberg failures (#2) are a pre-existing environment grant gap on antalya-26.8 and are out of scope for this PR.

@zvonand
zvonand merged commit fe37002 into antalya-26.8 Oct 26, 2026
272 of 282 checks passed
@zvonand zvonand added the verified Approved for release label Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants