ClickHouse® is a real-time analytics DBMS
Go to file
Azat Khuzhin f37dac03f4 Fix lock-order-inversion between DROP TABLE for DatabaseMemory and LiveView
CI stress founds [1], TSan report:

WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=509)
  Cycle in lock order graph: M71436201 (0x7b5800a91308) => M237700395169415472 (0x000000000000) => M71436201

  Mutex M237700395169415472 acquired here while holding mutex M71436201 in thread T723:
    3 std::__1::lock_guard<std::__1::mutex>::lock_guard(std::__1::mutex&) obj-x86_64-linux-gnu/../contrib/libcxx/include/__mutex_base:91:27 (clickhouse+0x154b0db9)
    4 DB::DatabaseWithOwnTablesBase::tryGetTable() const obj-x86_64-linux-gnu/../src/Databases/DatabasesCommon.cpp:37:21 (clickhouse+0x154b0db9)
    5 DB::DatabaseMemory::tryGetTableUUID() const obj-x86_64-linux-gnu/../src/Databases/DatabaseMemory.cpp:95:22 (clickhouse+0x15466bb5)
    6 DB::Context::resolveStorageID() const obj-x86_64-linux-gnu/../src/Interpreters/Context.cpp:2672:90 (clickhouse+0x155e6aa1)
    7 DB::JoinedTables::getLeftTableStorage() obj-x86_64-linux-gnu/../src/Interpreters/JoinedTables.cpp:200:29 (clickhouse+0x15eee962)
    8 DB::InterpreterSelectQuery::InterpreterSelectQuery() obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectQuery.cpp:321:33 (clickhouse+0x15b792be)
    9 DB::InterpreterSelectQuery::InterpreterSelectQuery() obj-x86_64-linux-gnu/../src/Interpreters/InterpreterSelectQuery.cpp:160:7 (clickhouse+0x15b78160)
    10 DB::StorageLiveView::collectMergeableBlocks() obj-x86_64-linux-gnu/../src/Storages/LiveView/StorageLiveView.cpp:113:28 (clickhouse+0x16aae192)
    11 DB::StorageLiveView::getNewBlocks() obj-x86_64-linux-gnu/../src/Storages/LiveView/StorageLiveView.cpp:384:33 (clickhouse+0x16ab393a)
    12 DB::StorageLiveView::refresh(bool) obj-x86_64-linux-gnu/../src/Storages/LiveView/StorageLiveView.cpp:528:13 (clickhouse+0x16ab6395)
    13 DB::StorageLiveView::read() obj-x86_64-linux-gnu/../src/Storages/LiveView/StorageLiveView.cpp:545:9 (clickhouse+0x16ab6395)
    21 DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum) obj-x86_64-linux-gnu/../src/Interpreters/executeQuery.cpp:950:30 (clickhouse+0x16101441)

    Hint: use TSAN_OPTIONS=second_deadlock_stack=1 to get more informative warning message

  Mutex M71436201 acquired here while holding mutex M237700395169415472 in thread T723:
    3 std::__1::lock_guard<std::__1::mutex>::lock_guard(std::__1::mutex&) obj-x86_64-linux-gnu/../contrib/libcxx/include/__mutex_base:91:27 (clickhouse+0x16ab5c29)
    4 DB::StorageLiveView::drop() obj-x86_64-linux-gnu/../src/Storages/LiveView/StorageLiveView.cpp:477:21 (clickhouse+0x16ab5c29)
    5 DB::DatabaseMemory::dropTable() obj-x86_64-linux-gnu/../src/Databases/DatabaseMemory.cpp:44:16 (clickhouse+0x15465cd6)
    8 DB::InterpreterDropQuery::execute() obj-x86_64-linux-gnu/../src/Interpreters/InterpreterDropQuery.cpp:62:16 (clickhouse+0x15afa679)

  [1]: https://clickhouse-test-reports.s3.yandex.net/29856/42ca2b4bb241827edf69bbd6938d6b19c31935f1/stress_test_(thread).html#fail1

v2: fix attachTableUnlocked() (as pointed by @tavplubix)
v3: use SCOPE_EXIT() and so avoid holding a lock during removing from fs
2021-10-10 23:51:36 +03:00
.github [github] we're switching to CLA based on Apache CLA 2021-09-28 10:38:53 +03:00
base Merge pull request #29683 from myrrc/improvement/tl-to-common 2021-10-05 21:49:15 +03:00
benchmark .tech -> .com 2021-09-22 03:22:57 +03:00
cmake Merge pull request #29682 from traceon/xcode-13-fix-build 2021-10-04 02:34:43 +03:00
contrib Merge pull request #29925 from ClickHouse/update-cctz-2 2021-10-10 02:17:09 +03:00
debian Add lld into Build-Depends for debian package 2021-09-25 02:18:36 +03:00
docker Merge pull request #29856 from azat/clickhouse-test-python-client 2021-10-09 17:58:40 +03:00
docs Merge pull request #29753 from kirillikoff/kirillikoff-DOCSUP-13583 2021-10-08 11:02:00 +03:00
programs Merge pull request #29898 from ClickHouse/remove-native-stream 2021-10-10 21:01:16 +03:00
src Fix lock-order-inversion between DROP TABLE for DatabaseMemory and LiveView 2021-10-10 23:51:36 +03:00
tests Grep server log even if it contains binary data (#29903) 2021-10-10 12:55:37 +03:00
utils Update Native. 2021-10-08 20:21:19 +03:00
website Revert "repo.clickhouse.tech is not 100% ready" 2021-09-29 02:43:20 +03:00
.clang-format Fixed wrong code around Memory Profiler 2020-03-03 03:24:44 +03:00
.clang-tidy Revert "Revert "Fix tidy"" 2021-09-06 12:16:52 +03:00
.editorconfig
.gitattributes Union merge for arcadia_skip_list.txt to avoid frequent conflicts 2021-03-10 08:50:32 +03:00
.gitignore fix style check 2021-09-21 10:28:33 +03:00
.gitmodules Initial: replacing hardcoded toString for enums with magic_enum 2021-09-06 16:24:03 +02:00
.potato.yml Fix yamllint issues 2021-02-20 23:25:21 +03:00
.pylintrc Add pylintrc config 2021-01-26 23:35:56 +03:00
.vimrc
.yamllint Drop truthy.check-keys from yamllint (does not supported on CI) 2021-02-21 06:15:36 +03:00
AUTHORS Update AUTHORS 2021-09-22 11:38:03 +03:00
CHANGELOG.md Update CHANGELOG.md 2021-10-09 18:42:53 +03:00
CMakeLists.txt Add -fcoroutines for g++ 2021-10-08 15:06:09 +03:00
CODE_OF_CONDUCT.md
CONTRIBUTING.md Remove old CLA 2021-09-28 20:16:33 +03:00
docker-compose.yml Change Docker org name 2021-09-20 01:52:21 +03:00
format_sources
LICENSE Sync copyrights 2021-10-04 09:16:18 +03:00
PreLoad.cmake
README.md Update README.md 2021-10-04 17:12:29 +03:00
release Proper build 2021-08-24 00:09:19 +00:00
SECURITY.md Update SECURITY.md 2021-10-07 20:30:07 +03:00
uncrustify.cfg

ClickHouse — open source distributed column-oriented DBMS

ClickHouse® is an open-source column-oriented database management system that allows generating analytical data reports in real time.

  • Official website has quick high-level overview of ClickHouse on main page.
  • Tutorial shows how to set up and query small ClickHouse cluster.
  • Documentation provides more in-depth information.
  • YouTube channel has a lot of content about ClickHouse in video format.
  • Slack and Telegram allow to chat with ClickHouse users in real-time.
  • Blog contains various ClickHouse-related articles, as well as announcements and reports about events.
  • Code Browser with syntax highlight and navigation.
  • Contacts can help to get your questions answered if there are any.