Fix data-race between LogSink::writeMarks() and LogSource in StorageLog#29946
Merged
alexey-milovidov merged 1 commit intoClickHouse:masterfrom Oct 14, 2021
Merged
Fix data-race between LogSink::writeMarks() and LogSource in StorageLog#29946alexey-milovidov merged 1 commit intoClickHouse:masterfrom
alexey-milovidov merged 1 commit intoClickHouse:masterfrom
Conversation
3a47e54 to
a5738a3
Compare
alexey-milovidov
approved these changes
Oct 10, 2021
Member
|
Thank you! It's interesting how this issue is found only now. Is it broken only recently? |
Member
Author
I think this one, fuzzer is really worthwhile thing! |
… in StorageLog
CI founds [1], TSan report:
WARNING: ThreadSanitizer: data race (pid=497)
Write of size 8 at 0x7b1c00e4e8d8 by thread T922:
4 DB::LogSink::writeMarks() obj-x86_64-linux-gnu/../src/Storages/StorageLog.cpp:462:72 (clickhouse+0x1665cdaa)
5 DB::LogSink::consume() obj-x86_64-linux-gnu/../src/Storages/StorageLog.cpp:324:5 (clickhouse+0x1665c216)
Previous read of size 8 at 0x7b1c00e4e8d8 by thread T711:
1 DB::LogSource::readData()::$_0::operator()(bool) const::'lambda'()::operator()() const obj-x86_64-linux-gnu/../src/Storages/StorageLog.cpp:188:26 (clickhouse+0x16661baf)
9 DB::LogSource::readData() obj-x86_64-linux-gnu/../src/Storages/StorageLog.cpp:204:20 (clickhouse+0x1665bbcb)
[1]: https://clickhouse-test-reports.s3.yandex.net/29930/4bc90d1dd7dbd4b8a9b6920d00ca24e8b160358e/stress_test_(thread).html#fail1
Fixes: ClickHouse#29470
v2: rework locking, but this produce deadlock for 01499_log_deadlock test
v3: introduce per-file marks mutex
a5738a3 to
eba6410
Compare
Member
Author
|
This was referenced Oct 15, 2021
robot-clickhouse
pushed a commit
that referenced
this pull request
Oct 15, 2021
…and LogSource in StorageLog
robot-clickhouse
pushed a commit
that referenced
this pull request
Oct 15, 2021
…and LogSource in StorageLog
robot-clickhouse
pushed a commit
that referenced
this pull request
Oct 15, 2021
…and LogSource in StorageLog
robot-clickhouse
pushed a commit
that referenced
this pull request
Oct 15, 2021
…and LogSource in StorageLog
robot-clickhouse
pushed a commit
that referenced
this pull request
Oct 15, 2021
… and LogSource in StorageLog
alexey-milovidov
added a commit
that referenced
this pull request
Oct 16, 2021
Backport #29946 to 21.10: Fix data-race between LogSink::writeMarks() and LogSource in StorageLog
alexey-milovidov
added a commit
that referenced
this pull request
Oct 17, 2021
Backport #29946 to 21.9: Fix data-race between LogSink::writeMarks() and LogSource in StorageLog
alexey-milovidov
added a commit
that referenced
this pull request
Oct 23, 2021
Backport #29946 to 21.8: Fix data-race between LogSink::writeMarks() and LogSource in StorageLog
This file contains hidden or 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
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.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix data-race between
LogSink::writeMarks()andLogSourceinStorageLogDetailed description / Documentation draft:
CI founds [1], TSan report:
Details
Fixes: #29470