Skip to content

Fix data part check and consistency check for tables with JSON column - #103858

Merged
Avogar merged 2 commits into
masterfrom
fix-json-check-part
May 2, 2026
Merged

Avogar merged 2 commits into
masterfrom
fix-json-check-part

Conversation

@Avogar

@Avogar Avogar commented May 1, 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 into CHANGELOG.md):

Fix data part check and consistency check for talbes with JSON column. Previously it could lead to false positive errors about missing files.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.5.1.250
  • Backported to: 26.4.1.1141, 26.3.11.5, 26.2.19.8

@Avogar Avogar added the pr-must-backport Pull request should be backported intentionally. Use this label with great care! label May 1, 2026
@clickhouse-gh

clickhouse-gh Bot commented May 1, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [61c4634]

Summary: ❌

job_name test_name status info comment
Performance Comparison (arm_release, master_head, 5/6) FAIL
distinct_in_order #6::old FAIL query history
distinct_in_order #6::new FAIL query history
logical_functions_medium #2::old FAIL query history
logical_functions_medium #2::new FAIL query history
logical_functions_medium #3::old FAIL query history
logical_functions_medium #3::new FAIL query history
logical_functions_small #9::old FAIL query history
logical_functions_small #9::new FAIL query history
logical_functions_small #13::old FAIL query history
logical_functions_small #13::new FAIL query history
2 more test cases not shown
Finish Workflow FAIL
python3 ./ci/jobs/scripts/workflow_hooks/check_report_messages.py FAIL

AI Review

Summary

This PR changes wide-part consistency/checksum validation to use columns_substreams.txt when available, with a fallback path for parts that do not have that file, and adds a JSON stateless test. The core fix direction looks correct, but test coverage is still incomplete for the fallback branch and should be extended before merge.

PR Metadata
  • Changelog category is semantically correct (Bug Fix).
  • Changelog entry is required for this category and is present, but it contains a typo: talbes → tables.
  • Suggested replacement:
    • Fix data part check and consistency check for tables with JSON column. Previously it could lead to false positive errors about missing files.
Findings

⚠️ Majors

  • [tests/queries/0_stateless/04109_check_table_json_wide.sql:14] The added test validates the new path using columns_substreams.txt, but it does not exercise the fallback branch for parts without columns_substreams.txt. That leaves the changed fallback behavior for JSON under-tested.
    • Suggested fix: add a regression test that validates both outcomes for old-format parts (no false positives for valid parts, and still-detected real corruption).
Tests
  • ⚠️ Missing coverage for the fallback code path without columns_substreams.txt.
ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ⚠️ Typo in Changelog entry (talbes → tables)
Safe rollout ✅
Compilation time ✅
No large/binary files ✅
Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required actions:
    1. Add fallback-branch regression coverage for parts without columns_substreams.txt.
    2. Fix the typo in Changelog entry (talbes → tables).

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label May 1, 2026
@clickhouse-gh

clickhouse-gh Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.10% 84.00% -0.10%
Functions 91.10% 91.10% +0.00%
Branches 76.60% 76.60% +0.00%

Changed lines: 31.20% (39/125) | lost baseline coverage: 7 line(s) · Uncovered code

Full report · Diff report

@alexey-milovidov alexey-milovidov changed the title Fix data part check and consistency check for talbes with JSON column Fix data part check and consistency check for tables with JSON column May 2, 2026
@Avogar
Avogar added this pull request to the merge queue May 2, 2026
Merged via the queue into master with commit 4e4a4c0 May 2, 2026
163 of 165 checks passed
@Avogar
Avogar deleted the fix-json-check-part branch May 2, 2026 10:25
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label May 2, 2026
robot-ch-test-poll4 added a commit that referenced this pull request May 2, 2026
Cherry pick #103858 to 26.2: Fix data part check and consistency check for tables with JSON column
robot-clickhouse added a commit that referenced this pull request May 2, 2026
robot-ch-test-poll4 added a commit that referenced this pull request May 2, 2026
Cherry pick #103858 to 26.3: Fix data part check and consistency check for tables with JSON column
robot-clickhouse added a commit that referenced this pull request May 2, 2026
robot-ch-test-poll4 added a commit that referenced this pull request May 2, 2026
Cherry pick #103858 to 26.4: Fix data part check and consistency check for tables with JSON column
robot-clickhouse added a commit that referenced this pull request May 2, 2026
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label May 2, 2026
@clickgapai

Copy link
Copy Markdown
Contributor

Hi @Avogar @KochetovNicolai — while reviewing this PR I found the following:

Could you review the test PR and add the can be tested label if it looks good?
Happy to discuss — close anything that's wrong or already addressed.

alexey-milovidov added a commit that referenced this pull request May 5, 2026
Backport #103858 to 26.4: Fix data part check and consistency check for tables with JSON column
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label May 9, 2026
@Avogar

Avogar commented May 12, 2026

Copy link
Copy Markdown
Member Author

We need to revert this PR, because due to bug fixed in #102689 we might have corrupted columns_substreams.txt file and after this PR we might rely on corrupted information and throw false-positive error. We need to do it more carefully and detect the corrupted columns_substreams.txt and don't use it at all (it's safe).

pull Bot pushed a commit to Mu-L/ClickHouse that referenced this pull request May 19, 2026
Apply the edit-changelog skill workflow to the autogenerated 26.5 section:
add the release header, drop the NO CL ENTRY and NOT FOR CHANGELOG /
INSIGNIFICANT sections, rescue user-visible entries into Bug Fix,
Performance Improvement and Improvement, reconcile reverted PRs against
the rest of the changelog (drop entries for ClickHouse#102801, ClickHouse#103547, ClickHouse#103858,
ClickHouse#104800), record the isPrime / isProbablePrime revert-of-revert and
follow-up PRs on the original entry, prune Build/Testing to user-affecting
items, and apply a focused round of per-entry rewrites (proper-noun
capitalization, backticked identifiers, common typos).

Date, presentation URL and video URL in the release header are left as
FIXME placeholders.
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…3858

Backport ClickHouse#103858 to 26.4: Fix data part check and consistency check for tables with JSON column
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-bugfix Pull request with bugfix, not backported by default pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR 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.

6 participants