Skip to content

Try to improve JSON column size lazy calculation - #83877

Merged
Avogar merged 11 commits into
ClickHouse:masterfrom
Avogar:improve-json-column-size-calculation
Aug 19, 2025
Merged

Avogar merged 11 commits into
ClickHouse:masterfrom
Avogar:improve-json-column-size-calculation

Conversation

@Avogar

@Avogar Avogar commented Jul 16, 2025

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

...

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

@Avogar
Avogar requested a review from KochetovNicolai July 16, 2025 20:09
@clickhouse-gh

clickhouse-gh Bot commented Jul 16, 2025 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [eefd1b5]

Summary: ❌

job_name test_name status info comment
Stateless tests (amd_binary, old analyzer, s3 storage, DatabaseReplicated, parallel) failure
02443_detach_attach_partition FAIL
Stateless tests (arm_binary, parallel) failure
01825_new_type_json_ghdata_insert_select FAIL
Integration tests (aarch64, distributed plan, 1/4) failure
test_backup_restore_on_cluster/test.py::test_replicated_table_after_alters FAIL

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jul 16, 2025
@Avogar
Avogar marked this pull request as ready for review July 23, 2025 10:41
@Avogar

Avogar commented Jul 24, 2025

Copy link
Copy Markdown
Member Author

I had to rewrite the code to avoid lock order inversion. We have to keep locks order parts_lock -> columns_and_secondary_indices_sizes_mutex. It makes code a bit tricky but I couldn't make it better.

@Avogar

Avogar commented Aug 18, 2025

Copy link
Copy Markdown
Member Author

Stateless tests (amd_binary, old analyzer, s3 storage, DatabaseReplicated, parallel) - #54748

Stateless tests (arm_binary, parallel) - #84577

Integration tests (aarch64, distributed plan, 1/4) - didn't find such failure anywhere else, but it seems unrelated to the changes, maybe some reallt rare flaky test

@Avogar
Avogar added this pull request to the merge queue Aug 19, 2025
Merged via the queue into ClickHouse:master with commit 71ef332 Aug 19, 2025
@Avogar
Avogar deleted the improve-json-column-size-calculation branch August 19, 2025 11:09
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 19, 2025
azat added a commit to azat/ClickHouse that referenced this pull request Jan 26, 2026
PR#85535 splits parts lock into read and write, but, it also removes one
optimization that is made by ClickHouse#83877, revert it back, since it is likely
still make sense.
if (hasColumnsWithDynamicSubcolumns(getInMemoryMetadataPtr()->getSampleBlock()))
{
DataParts data_parts(committed_parts_range.begin(), committed_parts_range.end());
parts_lock.lock.unlock();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I lost this during reviewing #85535 - #95207

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog 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.

4 participants