-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix clickhouse-copier cleaning-tainting contention between concurrent workers #7816
Merged
alexey-milovidov
merged 2 commits into
ClickHouse:master
from
dingxiangfei2009:fix-copier-contention-master
Nov 23, 2019
Merged
Fix clickhouse-copier cleaning-tainting contention between concurrent workers #7816
alexey-milovidov
merged 2 commits into
ClickHouse:master
from
dingxiangfei2009:fix-copier-contention-master
Nov 23, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89e2d1e
to
c66d21d
Compare
Sorry, I will let the functional tests finish before patching the style problems. |
c66d21d
to
6667961
Compare
Strange to see that |
Probably not related to your changes, it's a known flappy test. |
6667961
to
8330a09
Compare
alexey-milovidov
approved these changes
Nov 23, 2019
alexey-milovidov
approved these changes
Nov 23, 2019
nikitamikhaylov
pushed a commit
that referenced
this pull request
Dec 2, 2019
…master Fix clickhouse-copier cleaning-tainting contention between concurrent workers (cherry picked from commit eb7f48a)
nikitamikhaylov
pushed a commit
that referenced
this pull request
Dec 2, 2019
…master Fix clickhouse-copier cleaning-tainting contention between concurrent workers (cherry picked from commit eb7f48a)
nikitamikhaylov
pushed a commit
that referenced
this pull request
Dec 2, 2019
…master Fix clickhouse-copier cleaning-tainting contention between concurrent workers (cherry picked from commit eb7f48a)
vitlibar
pushed a commit
that referenced
this pull request
Dec 26, 2019
…master Fix clickhouse-copier cleaning-tainting contention between concurrent workers (cherry picked from commit eb7f48a)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Changelog category (leave one):
Changelog entry (up to few sentences, required except for Non-significant/Documentation categories):
clickhouse-copier
contention when target partition is dirty and workers run into race to clean it...
Detailed description:
When multiple
ClusterCopier
s discover that the target partition is not empty, they will attempt to clean up this partition before proceeding to copying.However, consider the following steps done by three workers in an interleaving fashion, which leads to no progress being made by any of the three workers.
Suppose there are three workers: A, B, C.
is_dirty
flag. B sleeps....
From Step 7 onwards, the role of the worker A and C can be swapped and steps from No. 3 can be repeated. Now we have a cleaning-tainting flip-flopping loop between A and C.
This PR will make
clickhouse-copier
to mitigate this issue with the following modifications.is_dirty
, the history of cleaning work is preserved and partition hygiene is established based on a happens-before relation between the events. This relation is encoded byLogicalClock
based on themzxid
of theis_dirty
ZNode andis_dirty/cleaned
. The fact of the partition hygiene is encoded byCleanStateClock
....