ClickHouse/src
Azat Khuzhin 9a71598973 Fix table lifetime in case of parallel DROP TABLE and INSERT
Stress tests founds [1]:

==527==WARNING: MemorySanitizer: use-of-uninitialized-value
    0 0x37078ffd in unsigned long std::__1::__cxx_atomic_fetch_add<unsigned long>(std::__1::__cxx_atomic_base_impl<unsigned long>*, unsigned long, std::__1::memory_order) obj-x86_64-linux-gnu/../contrib/libcxx/include/atomic:1050:12
    1 0x37078ffd in std::__1::__atomic_base<unsigned long, true>::fetch_add(unsigned long, std::__1::memory_order) obj-x86_64-linux-gnu/../contrib/libcxx/include/atomic:1719:17
    2 0x37078ffd in std::__1::__atomic_base<unsigned long, true>::operator++() obj-x86_64-linux-gnu/../contrib/libcxx/include/atomic:1756:57
    3 0x37078ffd in SimpleIncrement::get() obj-x86_64-linux-gnu/../src/Common/SimpleIncrement.h:20:16
    4 0x37078ffd in DB::MergeTreeDataWriter::writeTempPart(DB::BlockWithPartition&, std::__1::shared_ptr<DB::StorageInMemoryMetadata const> const&, std::__1::shared_ptr<DB::Context const>) obj-x86_64-linux-gnu/../src/Storages/MergeTree/MergeTreeDataWriter.cpp:276:46
    5 0x373c446c in DB::MergeTreeSink::consume(DB::Chunk) obj-x86_64-linux-gnu/../src/Storages/MergeTree/MergeTreeSink.cpp:27:65

  Uninitialized value was created by a heap deallocation
    6 0x32d481e8 in DB::DatabaseCatalog::TableMarkedAsDropped::~TableMarkedAsDropped() obj-x86_64-linux-gnu/../src/Interpreters/DatabaseCatalog.h:248:12
    7 0x32d3c134 in DB::DatabaseCatalog::dropTableDataTask() obj-x86_64-linux-gnu/../src/Interpreters/DatabaseCatalog.cpp:908:1

  [1]: https://s3.amazonaws.com/clickhouse-test-reports/32534/fa6090f588dbf4cbb5f28bd2210847b070bb8218/stress_test__memory__actions_.html

The query was CREATE MATERIALIZED VIEW ... POPULATE AS SELECT ... from
00040_aggregating_materialized_view test.
2021-12-11 11:00:31 +03:00
..
Access Reduce IParser.h dependencies and dependents 2021-11-26 17:19:47 +01:00
AggregateFunctions Fix division by zero in avgWeighted with Decimal argument (#32303) 2021-12-07 13:32:26 +03:00
Backups Reduce dependencies on ASTIdentifier.h 2021-11-26 16:49:40 +01:00
Bridge Merge branch 'master' of https://github.com/ClickHouse/ClickHouse into retriable-http 2021-11-04 14:41:24 +00:00
Client Fix processing initial table (--table/stdin) in clickhouse-local 2021-12-10 22:08:03 +03:00
Columns Pass through version for aggregate function from SerializationAggregateFunction too 2021-12-05 21:45:07 +03:00
Common Done 2021-12-09 14:44:25 +00:00
Compression Merge pull request #31826 from CurtizJ/fix-uncompressed-cache 2021-11-27 17:36:52 +03:00
Coordination Add check for duplicate hostnames and IDs in KeeperConfig 2021-12-02 14:46:33 +03:00
Core Parallel reading from replicas (#29279) 2021-12-09 13:39:28 +03:00
Databases Merge pull request #32288 from ClickHouse/fix_xml_dict_cyclic_dependency 2021-12-06 20:02:38 +03:00
DataStreams rm NativeBlockOutputStream 2021-11-27 09:47:25 +00:00
DataTypes Merge pull request #32173 from zzsmdfj/MaterializedMySQL_support_VARBINARY 2021-12-06 19:56:58 +03:00
Dictionaries Merge pull request #32117 from kitaisreal/dictionaries-custom-query-condition-fix 2021-12-06 10:59:56 +03:00
Disks Fix bug 2021-12-06 14:32:32 +08:00
Formats Merge pull request #32113 from FrankChen021/url_http_header 2021-12-07 08:52:36 +03:00
Functions rename window function name 2021-12-10 09:59:50 +00:00
Interpreters Fix table lifetime in case of parallel DROP TABLE and INSERT 2021-12-11 11:00:31 +03:00
IO Parallel reading from replicas (#29279) 2021-12-09 13:39:28 +03:00
Parsers Change error codes to SYNTAX_ERROR 2021-12-08 21:29:50 +03:00
Processors Done 2021-12-09 14:44:25 +00:00
QueryPipeline Parallel reading from replicas (#29279) 2021-12-09 13:39:28 +03:00
Server Parallel reading from replicas (#29279) 2021-12-09 13:39:28 +03:00
Storages Merge pull request #32460 from kssenii/mongo-extend-auth 2021-12-11 10:42:15 +03:00
TableFunctions Reduce dependencies on ASTSelectWithUnionQuery.h 2021-11-26 19:27:16 +01:00
CMakeLists.txt Parallel reading from replicas (#29279) 2021-12-09 13:39:28 +03:00
NOTICE Remove DataStreams folder. 2021-10-15 23:18:20 +03:00