Skip to content

Rebuild projection for merges that reduces rows#62364

Merged
jsc0218 merged 19 commits intoClickHouse:masterfrom
ardenwick:fix-projection-merge
Aug 27, 2024
Merged

Rebuild projection for merges that reduces rows#62364
jsc0218 merged 19 commits intoClickHouse:masterfrom
ardenwick:fix-projection-merge

Conversation

@ardenwick
Copy link
Copy Markdown
Contributor

@ardenwick ardenwick commented Apr 6, 2024

Some merging modes can reduce number of rows during merges, where some deleted data in the parent part will still live in projections. So just rebuild all the projections for these modes.

  • CollapsingMergeTree
  • ReplacingMergeTree
  • VersionedCollapsingMergeTree
  • OPTIMIZE DEDUPLICATE
  • OPTIMIZE CLEANUP

Trying to close #24778

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 to CHANGELOG.md):

Rebuild projection for merges that reduce number of rows

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/


Modify your CI run:

NOTE: If your merge the PR with modified CI you MUST KNOW what you are doing
NOTE: Checked options will be applied if set before CI RunConfig/PrepareRunConfig step

Include tests (required builds will be added automatically):

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Unit tests
  • Performance tests
  • All with ASAN
  • All with TSAN
  • All with Analyzer
  • Add your option here

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Performance tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All with Aarch64
  • Add your option here

Extra options:

  • do not test (only style check)
  • disable merge-commit (no merge from master before tests)
  • disable CI cache (job reuse)

Only specified batches in multi-batch jobs:

  • 1
  • 2
  • 3
  • 4

@ardenwick ardenwick marked this pull request as draft April 6, 2024 19:40
@ardenwick ardenwick changed the title Fix projection merge for Collapsing/Replacing/VersionedCollapsingMergeTree Try fixing projection merge for Collapsing/Replacing/VersionedCollapsingMergeTree Apr 6, 2024
@ardenwick ardenwick changed the title Try fixing projection merge for Collapsing/Replacing/VersionedCollapsingMergeTree Try to fix projection merge for Collapsing/Replacing/VersionedCollapsingMergeTree Apr 6, 2024
@yariks5s yariks5s added the can be tested Allows running workflows for external contributors label Apr 6, 2024
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-bugfix Pull request with bugfix, not backported by default label Apr 6, 2024
@robot-ch-test-poll1
Copy link
Copy Markdown
Contributor

robot-ch-test-poll1 commented Apr 6, 2024

This is an automated comment for commit b381c9d with description of existing statuses. It's updated for the latest CI running

❌ Click here to open a full report in a separate page

Check nameDescriptionStatus
Performance ComparisonMeasure changes in query performance. The performance test report is described in detail here. In square brackets are the optional part/total tests❌ failure
Successful checks
Check nameDescriptionStatus
AST fuzzerRuns randomly generated queries to catch program errors. The build type is optionally given in parenthesis. If it fails, ask a maintainer for help✅ success
Bugfix validationChecks that either a new test (functional or integration) or there some changed tests that fail with the binary built on master branch✅ success
BuildsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
ClickBenchRuns [ClickBench](https://github.com/ClickHouse/ClickBench/) with instant-attach table✅ success
Compatibility checkChecks that clickhouse binary runs on distributions with old libc versions. If it fails, ask a maintainer for help✅ success
Docker keeper imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docker server imageThe check to build and optionally push the mentioned image to docker hub✅ success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ success
Flaky testsChecks if new added or modified tests are flaky by running them repeatedly, in parallel, with more randomization. Functional tests are run 100 times with address sanitizer, and additional randomization of thread scheduling. Integration tests are run up to 10 times. If at least once a new test has failed, or was too long, this check will be red. We don't allow flaky tests, read the doc✅ success
Install packagesChecks that the built packages are installable in a clear environment✅ success
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests✅ success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors✅ success
Style checkRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success
Unit testsRuns the unit tests for different release types✅ success
Upgrade checkRuns stress tests on server version from last release and then tries to upgrade it to the version from the PR. It checks if the new server can successfully startup without any errors, crashes or sanitizer asserts✅ success

@ardenwick ardenwick force-pushed the fix-projection-merge branch 2 times, most recently from 8aad207 to c436a63 Compare April 8, 2024 04:48
@ardenwick ardenwick force-pushed the fix-projection-merge branch from a08fe12 to 603a52c Compare April 8, 2024 08:41
@ardenwick ardenwick marked this pull request as ready for review April 8, 2024 08:42
@ardenwick ardenwick force-pushed the fix-projection-merge branch from e743211 to 2aec0d0 Compare April 8, 2024 10:52
@ardenwick ardenwick force-pushed the fix-projection-merge branch from 2aec0d0 to 8c2a371 Compare April 8, 2024 12:25
@ardenwick
Copy link
Copy Markdown
Contributor Author

Hi, the code is ready for review.

@ardenwick ardenwick changed the title Try to fix projection merge for Collapsing/Replacing/VersionedCollapsingMergeTree Rebuild projection for merges in Collapsing/Replacing/VersionedCollapsingMergeTree Apr 10, 2024
@ardenwick ardenwick changed the title Rebuild projection for merges in Collapsing/Replacing/VersionedCollapsingMergeTree Rebuild projection for merges that reduces rows Apr 10, 2024
@nikitamikhaylov
Copy link
Copy Markdown
Member

@amosbird Would you mind to take a look?

@amosbird
Copy link
Copy Markdown
Collaborator

amosbird commented May 9, 2024

@nikitamikhaylov Sure. Will take a look in this week.

@nikitamikhaylov
Copy link
Copy Markdown
Member

Hello @amosbird! I hope things are going well...

@amosbird
Copy link
Copy Markdown
Collaborator

@nikitamikhaylov I'm progressing a bit slowly, but it's on track. Will continue this week.

@jsc0218
Copy link
Copy Markdown
Contributor

jsc0218 commented Jul 23, 2024

@cangyin thanks for the contribution, would you mind update this pr to resolve the conflicts, so it is easy to review? Later, after this pr is merged (welcome to review it), we can add rebuild option to this pr? generally follow the logics of this requirement. I am taking over it.

@jsc0218 jsc0218 force-pushed the fix-projection-merge branch from 1e9c37d to 72c80c9 Compare August 8, 2024 01:48
@jsc0218 jsc0218 force-pushed the fix-projection-merge branch 3 times, most recently from 67a1124 to 22dad24 Compare August 10, 2024 02:36
@Slach
Copy link
Copy Markdown
Contributor

Slach commented Aug 21, 2024

;) heh, is this feature anounces in 24.8 release, will it merged before release?

@jsc0218
Copy link
Copy Markdown
Contributor

jsc0218 commented Aug 22, 2024

have some sync problem, should be merged after the release.

@jsc0218 jsc0218 added this pull request to the merge queue Aug 27, 2024
Merged via the queue into ClickHouse:master with commit 6289c65 Aug 27, 2024
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 27, 2024
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 pr-bugfix Pull request with bugfix, not backported by default 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.

Projections inconsistent results for ReplacingMergeTree/CollapsingMergeTree

8 participants