Skip to content
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 a race condition during concurrent ALTER COLUMN queries #4592

Merged
merged 5 commits into from
Mar 10, 2019

Conversation

ztlpn
Copy link
Contributor

@ztlpn ztlpn commented Mar 5, 2019

For changelog. Remove if this is non-significant change.

Category (leave one):

  • Bug Fix

Short description (up to few sentences):

Fix a race condition during concurrent ALTER COLUMN queries that could lead to a server crash (fixes issue #3421).

@ztlpn ztlpn force-pushed the fix-concurrent-alters2 branch 4 times, most recently from c89c30a to 9de59c8 Compare March 7, 2019 14:56
@ztlpn ztlpn force-pushed the fix-concurrent-alters2 branch from 9de59c8 to 09d0ae5 Compare March 7, 2019 18:05
@ztlpn ztlpn force-pushed the fix-concurrent-alters2 branch from 09d0ae5 to f7217d9 Compare March 7, 2019 18:17
@ztlpn ztlpn changed the title [WIP] Alter intention lock Fix a race condition during concurrent ALTER COLUMN queries Mar 7, 2019
@ztlpn ztlpn marked this pull request as ready for review March 7, 2019 18:37
*/
mutable RWLock data_lock = RWLockImpl::create();
/// It is taken for share for the entire INSERT query and the entire merge of the parts (for MergeTree).
/// ALTER queries acquire an exclusive lock to ensure
Copy link
Member

Choose a reason for hiding this comment

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

To ensure what?

Copy link
Member

Choose a reason for hiding this comment

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

... that no new data appear?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops :) I will add the missing part of the comment.

@alexey-milovidov alexey-milovidov merged commit 617a0a8 into master Mar 10, 2019
@abyss7 abyss7 added the pr-bugfix Pull request with bugfix, not backported by default label Apr 9, 2019
abyss7 pushed a commit to abyss7/ClickHouse that referenced this pull request Apr 12, 2019
Fix a race condition during concurrent ALTER COLUMN queries
abyss7 added a commit that referenced this pull request Apr 15, 2019
Merge pull request #4592 from yandex/fix-concurrent-alters2 (#4992)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix Pull request with bugfix, not backported by default
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants