Repository navigation
Stable 26.3 Backport of #131001 - Reuse the GCM cipher context between rows in encrypt/decrypt - #2899
Conversation
Reuse the GCM cipher context between rows in encrypt/decrypt Conflicts committed as-is; the next commit resolves them: - src/Functions/FunctionsAES.h (both modified)
Took the PR's declarations of `key_holder` and `ctx_key_state` in the decrypt path.
|
Port-AL: cherry-pick conflicts resolved by AI Conflicted files:
Commits:
|
CI triage for
|
| Check | Classification | PR-caused? |
|---|---|---|
| Integration tests (amd_binary 2/5, 4/5; amd_asan old analyzer 3/8, 5/8) — 40 tests | Infra: python-bottle:latest image arch flip, open issue #2879 |
No |
| Grype Scan (keeper, server-alpine) — 4 High CVEs | External: base image / vulnerability DB | No |
| DCO | Policy: the upstream merge commit has no Signed-off-by |
No |
SQLLogic test, PR |
Still pending | n/a |
1. Integration tests: test_storage_s3/test_sts.py (3) and test_database_glue/test.py (17), failing on both amd_binary and amd_asan
All 40 failures happen in cluster.start(), before any test body runs. The mock STS container cannot run the mounted clickhouse binary:
E Exception: Timed out while waiting for instance `sts.us-east-1.amazonaws.com' with ip address 172.16.3.8 to start. ...
E bash: line 1: /usr/bin/clickhouse: cannot execute: required file not found
- Cause: this is the open issue CI:
altinityinfra/python-bottle:latestflips architecture and breaks glue/STS/CAS tests #2879. The tests start the mock withimage="altinityinfra/python-bottle", tag="latest". That:latesttag is pushed one architecture at a time, so it flips between amd64 and arm64. When its architecture doesn't match the host binary's, the binary can't run there. - Evidence that it isn't this PR:
- This PR doesn't touch
tests/integration/and doesn't touch any S3, STS or Glue code. - On 2026-11-16 the same base commit (Stable 26.3: Bump to 26.3.64 #2872, head
f6a2ea1c= currentstable-26.3, which this PR is up to date with) passedtest_database_glue/test.py::test_list_tablesin the same shard. - Today the exact same
required file not foundfailures show up on PRs to other branches with unrelated changes: Antalya 26.3 Backport of #128217 - Evaluate thePARTITION BYexpression of file and object storage writes once per INSERT, not once per block #2907 (antalya-26.3, 24 failures) and Stable 26.8 Backport of #131001 - Reuse the GCM cipher context between rows in encrypt/decrypt #2902 (stable-26.8, 40 failures).
- This PR doesn't touch
- Next step: nothing to fix in this PR. Re-running won't help while
:latesthas the wrong architecture. The fix belongs in CI:altinityinfra/python-bottle:latestflips architecture and breaks glue/STS/CAS tests #2879: pintag=os.environ.get("DOCKER_PYTHON_BOTTLE_TAG", "latest")in those tests, or re-publish a multi-arch:latest. These failures can be ignored for merging this backport.
2. Grype Scan: clickhouse-keeper and clickhouse-server …-alpine, "4 high/critical vulnerabilities"
- Both images report the same 4 High CPE matches:
CVE-2026-95691,CVE-2026-95692,CVE-2026-88823,CVE-2026-107496. The Ubuntu-based server image is clean (0). - Evidence that it isn't this PR: two days ago Stable 26.3: Bump to 26.3.64 #2872 (same base) scanned 0 high/critical on every image. Today Antalya 26.3 Backport of #128217 - Evaluate the
PARTITION BYexpression of file and object storage writes once per INSERT, not once per block #2907 (antalya-26.3) and Stable 26.8 Backport of #131001 - Reuse the GCM cipher context between rows in encrypt/decrypt #2902 (stable-26.8) show the same "4 high/critical" on keeper and server-alpine and 0 on the Ubuntu server image. A change to a function's implementation can't change which packages are in the images, so the cause is new vulnerability DB entries or an updated Alpine base. - Next step: handle this on the branch or infra side (bump the Alpine base, or triage/ignore the CVEs). Nothing to do here.
3. DCO
- The PR contains the original upstream merge commit
bf2effa0b2("Merge pull request Reuse the GCM cipher context between rows in encrypt/decrypt ClickHouse/ClickHouse#131001 …"), which has noSigned-off-by. Other stable-26.3 backports such as Stable 26.3: Bump to 26.3.64 #2872 and Stable 26.3 Backport of #131154 - Reject out-of-rangeDecimalscale when reading aField#2850 fail DCO for the same reason. - Next step: none for the code. If DCO has to be green, a maintainer can use the DCO app's override. Fixing it by rewriting history would need a force-push, which I don't do.
4. Pending
SQLLogic test (and the aggregate PR status) were still running when I looked.
One caveat: the praktika report leaves out passing tests, so I couldn't confirm a per-test entry for 04337_encrypt_decrypt_block_modes. The suites that run it all report Failed: 0.
No changes pushed, because nothing in this PR needs fixing.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Improve performance of the
encrypt,decryptandtryDecryptfunctions 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:
Regression jobs to run: