Skip to content

Better adaptive granularity calculation for wide parts#18223

Merged
CurtizJ merged 8 commits intomasterfrom
delayed_last_mark_for_wide_parts
Dec 23, 2020
Merged

Better adaptive granularity calculation for wide parts#18223
CurtizJ merged 8 commits intomasterfrom
delayed_last_mark_for_wide_parts

Conversation

@alesapin
Copy link
Copy Markdown
Member

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Make better adaptive granularity calculation for merge tree wide parts.

@robot-clickhouse robot-clickhouse added the pr-improvement Pull request with some product improvements label Dec 18, 2020
@alesapin alesapin changed the title Delayed last mark for wide parts Better adaptive granularity calculation for wide parts Dec 18, 2020
@alesapin
Copy link
Copy Markdown
Member Author

fortunately, catch check works.

@alesapin
Copy link
Copy Markdown
Member Author

Stress test failures are not related to changes.

@alesapin alesapin requested a review from CurtizJ December 21, 2020 14:42
@CurtizJ CurtizJ merged commit 84ec393 into master Dec 23, 2020
@CurtizJ CurtizJ deleted the delayed_last_mark_for_wide_parts branch December 23, 2020 16:37
@CurtizJ CurtizJ self-assigned this Dec 23, 2020
azat added a commit to azat/ClickHouse that referenced this pull request Jan 5, 2021
In ClickHouse#17120 (that was reverted in ClickHouse#17918 already) marks adjustemnt was
introduced, but it may lead to corruption of marks files, that may cause
two things:
1) Incorrect marks files, which lead to reading more rows than there are
   (can be reproduced with `max_threads`>1 or/and `PREWHERE`, and
    `optimize_move_to_prewhere`)
2) Can't adjust last granule because it has X rows, but try to subtract Y
   rows (ClickHouse#9260)

And 1) is pretty hard to diagnosis, since it does not throw any error,
it just may return wrong result.

Fortunately both problems can be fixed with `OPTIMIZE TABLE ... [ FINAL]`.

Cc: @alesapin
Refs: ClickHouse#17943
Refs: ClickHouse#18223
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-improvement Pull request with some product improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants