Repository navigation
Antalya 26.8 Backport of #131001 - Reuse the GCM cipher context between rows in encrypt/decrypt - #2901
Merged
Conversation
Reuse the GCM cipher context between rows in encrypt/decrypt
9 of 30 tasks
Member
Collaborator
Author
CI triage for
|
| Check | Classification | PR-caused? |
|---|---|---|
Stateless tests (amd_binary, cas s3 storage, parallel): 03770_min_columns_to_activate_adaptive_write_buffer |
pre-existing | ❌ |
| Stateless tests (amd_asan_ubsan, cas s3 storage, parallel, 2/2) | infra (job hit its time limit) + same 03770 failure |
❌ |
| RegressionTestsRelease / Swarms | pre-existing / flaky (node failure feature) |
❌ |
| DCO | backport merge commits lack a Signed-off-by line (process check) |
❌ |
| AST fuzzer (amd_debug, targeted) | LOGICAL_ERROR in StrictResizeProcessor, a pipeline bug outside this PR's code |
❌ (likely) |
This PR only touches src/Functions/FunctionsAES.h (the SQL encrypt/decrypt functions), a perf test, and the new stateless test 04337_encrypt_decrypt_block_modes.
1. 03770_min_columns_to_activate_adaptive_write_buffer (both cas s3 storage lanes)
Code: 241. DB::Exception: Query memory limit exceeded: would use 50.34 MiB (attempt to allocate chunk of 2.00 MiB), maximum: 50.00 MiB. (MEMORY_LIMIT_EXCEEDED)
(in query: insert into metric_log_1 select * from generateRandom() limit 1 settings max_memory_usage = '50Mi' ...)
- Pre-existing. The same test fails the same way (code 241, just over the 50 MiB cap) on unrelated antalya-26.8 PRs:
- Antalya 26.8 Backport of #124721 - Do not check Azure disks from the server config against remote_url_allow_hosts #2905: both CAS lanes
- Antalya 26.8 Backport of #128217 - Evaluate the
PARTITION BYexpression of file and object storage writes once per INSERT, not once per block #2910: asan CAS 2/2 - Demo regression selection grows #2895: both CAS lanes
- The test measures memory used by MergeTree wide-part writes on the CAS storage. The SQL AES functions are not on that path.
- Next step: fix this separately on
antalya-26.8. Either raise the50Milimit for CAS storage or exclude the test on that storage with a tag.
2. Stateless tests (amd_asan_ubsan, cas s3 storage, parallel, 2/2): job timeout
WARNING: Job timed out: [Stateless tests (amd_asan_ubsan, cas s3 storage, parallel, 2/2)], timeout [12600], exit code [-15]
- The job was killed at the 3.5 h limit after 6640 of 6999 tests. All tests up to that point were
OK, apart from the03770failure above and one test the runner itself markedKNOWN: Random timeout with sanitizer. - The same shard finished (6853 passed) on Antalya 26.8 Backport of #124721 - Do not check Azure disks from the server config against remote_url_allow_hosts #2905 and Demo regression selection grows #2895. Here it was just slower, so this is an infra/runner-speed problem.
- The encryption tests that ran in this shard all passed:
01318_decrypt,02384_decrypt_bad_arguments,04327_encrypt_decrypt_constant_key_no_iv. - Next step: safe to re-run.
3. Regression release swarms
✘ [ Fail ] '/swarms/feature/node failure/check restart swarm node'
✘ [ Fail ] '/swarms/feature/node failure/cpu overload'
✘ [ Fail ] '/swarms/feature/node failure/cpu overload all swarm nodes'
File ".../swarms/tests/node_failure.py", line 108, in run_long_query
assert result.exitcode in expected_exitcodes
- Pre-existing / flaky.
cpu overloadandcpu overload all swarm nodesfail the same way on Antalya 26.8 Backport of #124721 - Do not check Azure disks from the server config against remote_url_allow_hosts #2905 and Antalya 26.8 Backport of #128217 - Evaluate thePARTITION BYexpression of file and object storage writes once per INSERT, not once per block #2910. check restart swarm nodeuses the samerun_long_queryassertion (an Iceberg swarm query run while nodes are killed or overloaded). That scenario has nothing to do withencrypt/decrypt.- Next step: none for this PR.
4. DCO
- The PR has two commits: the upstream merge commit
8a76e39f61("Merge pull request Reuse the GCM cipher context between rows in encrypt/decrypt ClickHouse/ClickHouse#131001…") and the merge ofantalya-26.8into the branch,33803c76b6. Neither carries aSigned-off-byline. - DCO also fails on Antalya 26.8 Backport of #124721 - Do not check Azure disks from the server config against remote_url_allow_hosts #2905 and Antalya 26.8 Backport of #128217 - Evaluate the
PARTITION BYexpression of file and object storage writes once per INSERT, not once per block #2910, so this is normal for backport PRs. - Next step: a maintainer can override DCO as usual. No code change needed.
5. AST fuzzer (amd_debug, targeted): server crash
Thread 285 "QueryPipelineEx" received signal SIGABRT, Aborted.
#6 DB::Exception::handleErrorCode (... code=49 ...) // LOGICAL_ERROR
#11 DB::StrictResizeProcessor::prepare (...) at src/Processors/ResizeProcessor.cpp:216
output_state = {status = DB::StrictResizeProcessor::OutputStatus::NotActive}
processor ... plan_step_name = "Aggregating"
ResizeProcessor.cpp:216raises"Invalid status NotActive for associated output". This is a port-state bug in the executor'sStrictResizeProcessor(inside anAggregatingstep), not in the function code.- The fuzzer queries contain
encrypt/decrypt/tryDecryptonly because the targeted fuzzer starts from this PR's new test04337_encrypt_decrypt_block_modes. The functions only compute row values and have no access to processor port state, so the cipher-context reuse change can't produce this assertion. - I found no existing issue for this message in Altinity/ClickHouse or ClickHouse/ClickHouse. The
server.logartifact goes past the 64 MiB fetch cap, so I couldn't pull out the exact failing query. - Next step: re-run the targeted fuzzer. If the crash reproduces, it's worth filing a separate issue about
StrictResizeProcessorwith the fuzzer artifacts. It doesn't block this backport.
Bottom line: No fix is needed on this PR. Re-run the asan CAS 2/2 shard and the targeted AST fuzzer. 03770 on CAS storage and the swarms node failure scenarios should be tracked separately for antalya-26.8.
Evidence: praktika result_pr.json for this SHA and for #2905/#2910/#2895, the fuzzer job.log gdb trace, and the swarms job log.
zvonand
approved these changes
Nov 20, 2026
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.
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: