Skip to content

Use sipHash128 instead of MD5 in test 03988_cached_read_big_at - #125527

Merged
antonio2368 merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-03988-fips-md5
Oct 14, 2026
Merged

antonio2368 merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-03988-fips-md5

Conversation

@groeneai

@groeneai groeneai commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #125010

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

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

Use sipHash128 instead of MD5 in the stateless test 03988_cached_read_big_at, so it also passes when OpenSSL FIPS mode is enabled.

Description

#125010 made 03988_cached_read_big_at generate its Parquet data from hash digests, one of them MD5, and dropped the stateful/long tags that kept it out of the OpenSSL FIPS stateless job. In FIPS mode the MD5 function throws SUPPORT_IS_DISABLED ("Function MD5 is not available in FIPS mode") when the query is analyzed, so the INSERT that writes the test file fails on every run there. That job runs only in the private repository's CI (it shows up as a CH Inc sync failure), so I cannot link a public failing job.

MD5 only produces 16 hex chars of pseudo-random data here. The change replaces it with sipHash128 at both sites (the data and the expected checksum), the same substitution as #116023. sipHash128 does not use OpenSSL and also returns FixedString(16), so substring(hex(...), 1, 16) keeps every value at 16 chars and the file keeps the same row groups and column chunk sizes (to within 1 byte). SHA256 stays: it is allowed in FIPS mode.

Validation: with FIPS mode on through OPENSSL_CONF (default_properties = fips=yes), master's test fails with the same Code: 344 error and the fixed test no longer hits it. My local build does not load the FIPS provider module, so a complete FIPS run was not possible. Without FIPS the fixed test passes 50/50 against MinIO.

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/125527]

Version info

  • Merged into: 26.10.1.2361-master (included in 26.10 and later)

`MD5` throws `SUPPORT_IS_DISABLED` in OpenSSL FIPS builds. ClickHouse#125010 dropped
the `stateful`/`long` tags and introduced the `MD5` call, so the test now
runs and fails there. `sipHash128` also returns `FixedString(16)`, so
`substring(hex(...), 1, 16)` keeps 16-char values and the same Parquet layout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-oranjeai PR origin: delegated from the OranjeAI sibling fleet labels Oct 12, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 0 findings) plus my own review (1 finding).

# Sev Finding Verdict Evidence / action
1 💡 SHA256 (kept at 4 sites) was not executed under a real FIPS provider locally DISAGREE SHA256Impl::available_in_fips_mode = true; f09ef8e tagged every test failing in FIPS mode and left the pure-SHA256 tests 01338_sha256_fixedstring and 02998_ipv6_hashing untagged

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are
terminal per finding.

Session id: cron:clickhouse-review-slot-10:20261012-222300

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. With OPENSSL_CONF setting default_properties = fips=yes, master's INSERT fails every time with Code: 344 ... Function MD5 is not available in FIPS mode, also end-to-end through clickhouse-test.
b Root cause explained? #125010 added MD5 to the data generation and removed the stateful/long tags that kept the test out of the FIPS job; the MD5 function refuses to be created in FIPS mode, so the INSERT throws at analysis.
c Fix matches root cause? Yes. The refused function is replaced by sipHash128 (no OpenSSL, same FixedString(16)); no skip tag, so the cache regression keeps running in FIPS builds.
d Test intent preserved / new tests added? Preserved: values stay 16 chars, same row groups and column chunk sizes (to within 1 byte), .reference unchanged, the profile-event lines still show the read going through the filesystem cache. Test-only change.
e Both directions demonstrated? Yes. Master text: Code: 344 in FIPS mode; fixed text: no Code: 344. Without FIPS the fixed test passes 50/50 against MinIO.
f Fix is general across code paths? Every digest in the file checked: both MD5 sites changed together; SHA256 is allowed in FIPS mode; cityHash64 and generateUUIDv4 have no FIPS check.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A (test-only).
h Backward compatible? (maintainer-approved exception only) N/A (test-only).
i Invariants and contracts preserved? The expected checksum uses the same expression as the INSERT at both changed sites, so the comparison in check() holds (50/50).

Session id: cron:clickhouse-impl-slot-4:20261012-220300

@groeneai
groeneai requested a review from antonio2368 October 12, 2026 22:43
@clickhouse-gh

clickhouse-gh Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [8fc8ecb]

Summary: ✅


AI Review

Summary

This PR replaces MD5 with sipHash128 in tests/queries/0_stateless/03988_cached_read_big_at.sh so the stateless filesystem-cache regression test keeps running in OpenSSL FIPS builds. I did not find any correctness, coverage, or contract issues in the change.

Missing context / blind spots
  • ⚠️ I did not execute 03988_cached_read_big_at under a local build with a real FIPS provider loaded; a private FIPS CI run would close that last runtime-validation gap. The code-level behavior matches the existing FIPS gates: MD5 is explicitly rejected in FIPS mode, while SHA256 remains allowed.
Final Verdict

✅ No review findings. The change updates both affected MD5 call sites together, keeps the test data and expected-checksum expressions in sync, and preserves the fixed-width hash shape the Parquet layout depends on closely enough for this regression test's purpose.

@clickhouse-gh clickhouse-gh Bot added pr-ci comp-testing Test content only (no production code). labels Oct 12, 2026
@antonio2368 antonio2368 self-assigned this Oct 13, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 8fc8ecb

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stateless tests (arm_binary, ParallelReplicas, s3 storage, parallel) / 05210_lightweight_update_materialized_cte_in_ignore flaky, not from this PR (it only changes the digest in 03988_cached_read_big_at.sh): Code: 60 ... Unknown table expression identifier '_materialized_cte_c_...' with parallel replicas, 0 of 126 reruns failed; it failed on 183 other PRs and 32 master runs in the last 7 days #123121 (mine, open)
Mergeable Check, PR praktika rollups of the row above #123121 (mine, open)

CIDB has no other FAIL or ERROR row on this head.

Session id: cron:our-pr-ci-monitor:20261013-080005

@antonio2368
antonio2368 added this pull request to the merge queue Oct 14, 2026
Merged via the queue into ClickHouse:master with commit 6a80f33 Oct 14, 2026
350 of 351 checks passed
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 14, 2026
opensource-fork-sync Bot pushed a commit to cla7aye15I4nd/opensource-ClickHouse__ClickHouse that referenced this pull request Nov 8, 2026
…ed_keys

The test fingerprints each serialized uniqExact*State as hex(MD5(hex(state))).
MD5 is refused in OpenSSL FIPS mode (FunctionMD5 throws SUPPORT_IS_DISABLED at
analysis), so in a FIPS build the test fails at its first state query
(query 12, line 42) and at every later one.

The digest is incidental: it only compresses a long hex string into a 128-bit
fingerprint. Replace MD5 with sipHash128 at all 69 call sites: it needs no
OpenSSL, exists in every build including Fast test, and returns
FixedString(16) like MD5, so the reference keeps its shape and size. Same
substitution as ClickHouse#125750 and ClickHouse#125527.

The new fingerprints were taken from a run printing both hashes of every
state: all 286 MD5 halves equal the old reference and the old-to-new mapping
is a bijection, so the reference still asserts the same states.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh clickhouse-gh Bot added comp-filesystem-cache Filesystem cache for remote/object storage, page cache, and read caching infrastructure. and removed comp-testing Test content only (no production code). labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-filesystem-cache Filesystem cache for remote/object storage, page cache, and read caching infrastructure. groeneai-origin-oranjeai PR origin: delegated from the OranjeAI sibling fleet pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants