Skip to content

Antalya 26.6 Backport of #131001 - Reuse the GCM cipher context between rows in encrypt/decrypt - #2900

Merged
zvonand merged 1 commit into
antalya-26.6from
backports/antalya-26.6/131001
Nov 18, 2026
Merged

zvonand merged 1 commit into
antalya-26.6from
backports/antalya-26.6/131001

Conversation

@blau-ai

@blau-ai blau-ai commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

  • Performance Improvement

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

Improve performance of the encrypt, decrypt and tryDecrypt functions in AES-GCM modes by up to 27x with many threads. (ClickHouse#131001 by @mkmkme)

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)

Reuse the GCM cipher context between rows in encrypt/decrypt
@github-actions

Copy link
Copy Markdown

Workflow [PR], commit [500e86c]

@zvonand

zvonand commented Nov 18, 2026

Copy link
Copy Markdown
Member

@blau-ai

@blau-ai

blau-ai commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

CI triage for 500e86c3 (Backport ClickHouse#131001: reuse the GCM cipher context in encrypt/decrypt)

Verdict: none of the failures come from this PR. There are 7 failing check groups: 0 caused by the PR, 4 integration infra (mock-container startup), 1 flaky CAS stateless test, and 2 policy checks (Grype, DCO) that also fail on other antalya-26.6 backports. SQLLogic and SQLStorm are still pending.

The PR changes src/Functions/FunctionsAES.h, a perf test, and the new 04337_encrypt_decrypt_block_modes test. Every stateless job except the one below is green, so the new encrypt/decrypt test passed under asan/ubsan, debug, binary, s3, and distributed-plan configs. None of the failing tests call encrypt or decrypt.

1. Integration tests (amd_asan_ubsan, db disk, old analyzer, 1/8, 4/8, 7/8, 8/8): 74 failures. Infra, not this PR

All 74 failures are fixture errors in cluster.start(). The mock-service containers (fakegcs, sts, sts.amazonaws.com, sts.us-east-1.amazonaws.com, which use images such as altinityinfra/python-bottle) never start:

E   Exception: Timed out while waiting for instance `sts.amazonaws.com' with ip address 172.16.2.7 to start. ...
E   bash: line 1: /usr/bin/clickhouse: cannot execute: required file not found

Affected suites: test_database_glue (29), test_cas_gcs (37), test_storage_s3/test_sts.py (4), test_datalake_glue_token_forwarding (3), test_cas_gcs_relink_liveness (1).

Evidence it is not this PR: #2848 is an unrelated antalya-26.6 backport (Decimal Field scale). Its Integration tests (amd_asan_ubsan, targeted) job fails on the same tests (test_storage_s3/test_sts.py::*, test_datalake_glue_token_forwarding::*, test_cas_gcs_relink_liveness::*) with the same cannot execute: required file not found error. tests/integration/helpers/cluster.py waits for ClickHouse in every instance, including these mock images. My guess is that the mounted binary can't run inside the current mock images (for example, a missing loader after an image update), but I haven't confirmed that.
Next step: CI/infra needs to look at the mock images, or at how cluster.py starts non-ClickHouse instances. Nothing to fix in this PR.

2. Stateless tests (amd_asan_ubsan, cas s3 storage, parallel, 2/2): 01162_strange_mutations. Flaky, CAS storage

Code: 341 ... Exception happened during execution of mutation '0000000001' with part 'all_0_0_0_2' reason:
'Code: 107. DB::Exception: dropRef: no such ref tmp_clone_all_0_0_0_3 in namespace stateless-ca-s3/store/...@cas@. (FILE_DOESNT_EXIST)'

The error comes from the CAS-storage mutation path (dropRef), not from functions. The test doesn't use encrypt/decrypt. The CI's randomized-settings diagnosis reran it and it passed: "All reruns passed. The failure is not reproducible." It passed in all other stateless configs, including cas s3 storage 1/2 and amd_binary, cas s3 storage.
Next step: Safe to ignore or re-run. If it keeps appearing on other PRs, it's a CAS ref-lifecycle race worth a separate issue.

3. Grype scans (keeper image, server -alpine image): 4 high/critical vulnerabilities each. Pre-existing

#2909, another antalya-26.6 backport, gets the same result: keeper and -alpine each report 4 high/critical, and the plain server image passes with 0. These findings are in base-image packages, and this PR changes no Docker or packaging files.

4. DCO: policy, not code

The PR head is the upstream merge commit 500e86c3 ("Merge pull request ClickHouse#131001 …"), which has no Signed-off-by. DCO fails the same way on #2909. Usual handling for backports applies (override, or ignore if it isn't required).

Suggested fixes for PR-related failures

None needed. Once SQLLogic/SQLStorm finish, the PR looks mergeable from a CI standpoint. A re-run of the stateless CAS shard is optional.

@zvonand
zvonand merged commit 18e11a0 into antalya-26.6 Nov 18, 2026
291 of 309 checks passed
@zvonand zvonand added the verified Approved for release label Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants