Commit Graph

31364 Commits

Author SHA1 Message Date
Alexey Milovidov
7f1e7b5967 Merge branch 'master' into fix-half-of-trash 2022-09-11 06:20:47 +02:00
Alexey Milovidov
05d0f48d17
Merge pull request #41173 from ClickHouse/remove-some-methods
Remove some methods
2022-09-11 07:19:52 +03:00
Alexey Milovidov
90fd507292 Fix test 2022-09-11 06:18:43 +02:00
Alexey Milovidov
512fb998f1 Fix ridiculous trash in Base58 2022-09-11 03:54:40 +02:00
Alexey Milovidov
cc38ac3764 Better parallel hash JOIN for floats 2022-09-11 03:04:44 +02:00
Alexey Milovidov
ae6c74a916 Merge branch 'master' into fix-half-of-trash 2022-09-11 02:30:56 +02:00
Alexey Milovidov
6f513dab6f
Merge pull request #41169 from ClickHouse/remove-trash-4
Fix strange code in DatabaseReplicated
2022-09-11 03:30:08 +03:00
Alexey Milovidov
2b6724c5e3 Fix example 2022-09-11 01:58:55 +02:00
Alexey Milovidov
b75d56ad9b Merge branch 'master' into remove-some-methods 2022-09-11 01:55:02 +02:00
Alexey Milovidov
91338ea771
Merge branch 'master' into remove-useless-line 2022-09-11 02:03:39 +03:00
Azat Khuzhin
c1e70169d2 Suppress clang-analyzer-cplusplus.NewDelete in MsgPackRowInputFormat
Appartently there is some issue with clang-15, since even the following
example shows error [1].

  [1]: https://gist.github.com/azat/027f0e949ea836fc2e6269113ceb8752

clang-tidy report [1]:

    FAILED: src/CMakeFiles/dbms.dir/Processors/Formats/Impl/MsgPackRowInputFormat.cpp.o                                                                                                            /usr/bin/cmake -E __run_co_compile --launcher="prlimit;--as=10000000000;--data=5000000000;--cpu=1000;/usr/bin/ccache" --tidy=/usr/bin/clang-tidy-15 --source=/ch/src/Processors/Formats/Impl/MsgPackRowInputFormat.cpp -- /usr/bin/clang++-15 --target=x86_64-linux-gnu --sysroot=/ch/cmake/linux/../../contrib/sysroot/linux-x86_64/x86_64-linux-gnu/libc  -DAWS_SDK_VERSION_MAJOR=1 -DAWS_SDK_VERSION_MINOR=7 -DAWS_SDK_VERSION_PATCH=231 -DBOOST_ASIO_HAS_STD_INVOKE_RESULT=1 -DBOOST_ASIO_STANDALONE=1 -DCARES_STATICLIB -DCONFIGDIR=\"\" -DENABLE_MULTITARGET_CODE=1 -DENABLE_OPENSSL_ENCRYPTION -DHAS_RESERVED_IDENTIFIER -DHAVE_CONFIG_H -DLIBSASL_EXPORTS=1 -DLZ4_DISABLE_DEPRECATE_WARNINGS=1 -DOBSOLETE_CRAM_ATTR=1 -DOBSOLETE_DIGEST_ATTR=1 -DPLUGINDIR=\"\" -DPOCO_ENABLE_CPP11 -DPOCO_HAVE_FD_EPOLL -DPOCO_OS_FAMILY_UNIX -DSASLAUTHD_CONF_FILE_DEFAULT=\"\" -DSNAPPY_CODEC_AVAILABLE -DSTD_EXCEPTION_HAS_STACK_TRACE=1 -DUNALIGNED_OK -DWITH_COVERAGE=0 -DWITH_GZFILEOP -DX86_64 -DZLIB_COMPAT -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Iincludes/configs -I/ch/src -Isrc -Isrc/Core/include -I/ch/base/glibc-compatibility/memcpy -I/ch/base/base/.. -Ibase/base/.. -I/ch/contrib/cctz/include -I/ch/base/pcg-random/. -I/ch/contrib/miniselect/include -I/ch/contrib/zstd/lib -Icontrib/cyrus-sasl-cmake -I/ch/contrib/lz4/lib -I/ch/src/Common/mysqlxx/. -Icontrib/c-ares -I/ch/contrib/c-ares -I/ch/contrib/c-ares/include -isystem /ch/contrib/libcxx/include -isystem /ch/contrib/libcxxabi/include -isystem /ch/contrib/libunwind/include -isystem /ch/contrib/libdivide/. -isystem /ch/contrib/jemalloc-cmake/include -isystem /ch/contrib/llvm/llvm/include -isystem contrib/llvm/llvm/include -isystem /ch/contrib/abseil-cpp -isystem /ch/contrib/croaring/cpp -isystem /ch/contrib/croaring/include -isystem /ch/contrib/cityhash102/include -isystem /ch/contrib/boost -isystem /ch/contrib/poco/Net/include -isystem /ch/contrib/poco/Foundation/include -isystem /ch/contrib/poco/NetSSL_OpenSSL/include -isystem /ch/contrib/poco/Crypto/include -isystem /ch/contrib/boringssl/include -isystem /ch/contrib/poco/Util/include -isystem /ch/contrib/poco/JSON/include -isystem /ch/contrib/poco/XML/include -isystem /ch/contrib/replxx/include -isystem /ch/contrib/fmtlib-cmake/../fmtlib/include -isystem /ch/contrib/magic_enum/include -isystem /ch/contrib/double-conversion -isystem /ch/contrib/dragonbox/include -isystem /ch/contrib/re2 -isystem contrib/re2-cmake -isystem /ch/contrib/zlib-ng -isystem contrib/zlib-ng-cmake -isystem /ch/contrib/pdqsort -isystem /ch/contrib/xz/src/liblzma/api -isystem /ch/contrib/aws-c-common/include -isystem /ch/contrib/aws-c-event-stream/include -isystem /ch/contrib/aws/aws-cpp-sdk-s3/include -isystem /ch/contrib/aws/aws-cpp-sdk-core/include -isystem contrib/aws-s3-cmake/include -isystem /ch/contrib/snappy -isystem contrib/snappy-cmake -isystem /ch/contrib/msgpack-c/include -isystem /ch/contrib/fast_float/include -isystem /ch/contrib/librdkafka-cmake/include -isystem /ch/contrib/librdkafka/src -isystem contrib/librdkafka-cmake/auxdir -isystem /ch/contrib/cppkafka/include -isystem /ch/contrib/nats-io/src -isystem /ch/contrib/nats-io/src/adapters -isystem /ch/contrib/nats-io/src/include -isystem /ch/contrib/nats-io/src/unix -isystem /ch/contrib/libuv/include -isystem /ch/contrib/krb5/src/include -isystem contrib/krb5-cmake/include -isystem /ch/contrib/NuRaft/include -isystem /ch/contrib/poco/MongoDB/include -isystem contrib/mariadb-connector-c-cmake/include-public -isystem /ch/contrib/mariadb-connector-c/include -isystem /ch/contrib/mariadb-connector-c/libmariadb -isystem /ch/contrib/icu/icu4c/source/i18n -isystem /ch/contrib/icu/icu4c/source/common -isystem /ch/contrib/capnproto/c++/src -isystem /ch/contrib/arrow/cpp/src -isystem /ch/contrib/arrow-cmake/cpp/src -isystem contrib/arrow-cmake/cpp/src -isystem contrib/arrow-cmake/../orc/c++/include -isystem /ch/contrib/orc/c++/include -isystem contrib/avro-cmake/include -isystem /ch/contrib/avro/lang/c++/api -isystem /ch/contrib/openldap-cmake/linux_x86_64/include -isystem /ch/contrib/openldap/include -isystem /ch/contrib/sparsehash-c11 -isystem /ch/contrib/protobuf/src -isystem src/Server/grpc_protos -isystem /ch/contrib/grpc/include -isystem /ch/contrib/libhdfs3/include -isystem /ch/contrib/hive-metastore -isystem /ch/contrib/thrift/lib/cpp/src -isystem contrib/thrift-cmake -isystem /ch/contrib/azure/sdk/core/azure-core/inc-isystem /ch/contrib/azure/sdk/identity/azure-identity/inc -isystem /ch/contrib/azure/sdk/storage/azure-storage-common/inc -isystem /ch/contrib/azure/sdk/storage/azure-storage-blobs/inc -isystem /ch/contrib/s2geometry/src -isystem /ch/contrib/AMQP-CPP/include -isystem /ch/contrib/AMQP-CPP -isystem /ch/contrib/sqlite-amalgamation -isystem /ch/contrib/rocksdb/include -isystem /ch/contrib/libpqxx/include -isystem /ch/contrib/libpq -isystem /ch/contrib/libpq/include -isystem /ch/contrib/libstemmer_c/include -isystem /ch/contrib/wordnet-blast -isystem /ch/contrib/lemmagen-c/include -isystem /ch/contrib/simdjson/include -isystem /ch/contrib/rapidjson/include -isystem /ch/contrib/consistent-hashing --gcc-toolchain=/ch/cmake/linux/../../contrib/sysroot/linux-x86_64 -std=c++20 -fdiagnostics-color=always -Xclang -fuse-ctor-homing -fsized-deallocation  -UNDEBUG -gdwarf-aranges -pipe -mssse3 -msse4.1 -msse4.2 -mpclmul -mpopcnt -fasynchronous-unwind-tables -falign-functions=32 -mbranches-within-32B-boundaries -fdiagnostics-absolute-paths -fstrict-vtable-pointers -fexperimental-new-pass-manager -Wall -Wextra -Weverything -Wpedantic -Wno-zero -length-array -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-c++20-compat -Wno-conversion -Wno-ctad-maybe-unsupported -Wno-disabled-macro-expansion -Wno-documentation-unknown-command -Wno-double-promotion -Wno-exit-time-destructors -Wno-float-equal -Wno-global-constructors -Wno-missing-prototypes -Wno-missing-variable-declarations -Wno-padded -Wno-switch-enum -Wno-undefined-func-template -Wno-unused-template -Wno-vla -Wno-weak-template-vtables -Wno-weak-vtables -Wno-thread-safety-negative -g -O0 -g -gdwarf-4 -fno-inline  -D_LIBCPP_DEBUG=0   -D OS_LINUX -I/ch/base -I/ch/contrib/magic_enum/include -include /ch/src/Core/iostream_debug_helpers.h -Werror -nostdinc++ -std=gnu++2a -MD -MT src/CMakeFiles/dbms.dir/Processors/Formats/Impl/MsgPackRowInputFormat.cpp.o -MF src/CMakeFiles/dbms.dir/Processors/Formats/Impl/MsgPackRowInputFormat.cpp.o.d -o src/CMakeFiles/dbms.dir/Processors/Formats/Impl/MsgPackRowInputFormat.cpp.o -c /ch/src/Processors/Formats/Impl/MsgPackRowInputFormat.cpp

    /ch/contrib/msgpack-c/include/msgpack/v1/detail/cpp11_zone.hpp:195:9: error: Attempt to free released memory [clang-analyzer-cplusplus.NewDelete,-warnings-as-errors]
            ::free(p);
            ^
    /ch/src/Processors/Formats/Impl/MsgPackRowInputFormat.cpp:509:5: note: Taking false branch
        if (buf.eof())
        ^
    /ch/src/Processors/Formats/Impl/MsgPackRowInputFormat.cpp:514:24: note: Assuming 'i' is not equal to field 'number_of_columns'
        for (size_t i = 0; i != number_of_columns; ++i)
                           ^~~~~~~~~~~~~~~~~~~~~~
    /ch/src/Processors/Formats/Impl/MsgPackRowInputFormat.cpp:514:5: note: Loop condition is true.  Entering loop body
        for (size_t i = 0; i != number_of_columns; ++i)
        ^
    /ch/src/Processors/Formats/Impl/MsgPackRowInputFormat.cpp:516:30: note: Calling 'MsgPackSchemaReader::readObject'
            auto object_handle = readObject();
                                 ^~~~~~~~~~~~
    /ch/src/Processors/Formats/Impl/MsgPackRowInputFormat.cpp:426:5: note: Taking false branch
        if (buf.eof())
        ^
    /ch/src/Processors/Formats/Impl/MsgPackRowInputFormat.cpp:433:5: note: Loop condition is true.  Entering loop body
        while (need_more_data)
        ^
    /ch/src/Processors/Formats/Impl/MsgPackRowInputFormat.cpp:438:29: note: Calling 'unpack'
                object_handle = msgpack::unpack(buf.position(), buf.buffer().end() - buf.position(), offset);
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /ch/contrib/msgpack-c/include/msgpack/v3/unpack.hpp:52:12: note: Calling 'unpack'
        return msgpack::v3::unpack(data, len, off, referenced, f, user_data, limit);
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /ch/contrib/msgpack-c/include/msgpack/v3/unpack.hpp:35:5: note: Control jumps to the 'default' case at line 40
        switch(ret) {
        ^
    /ch/contrib/msgpack-c/include/msgpack/v3/unpack.hpp:41:9: note:  Execution continues on line 43
            break;
            ^
    /ch/contrib/msgpack-c/include/msgpack/v3/unpack.hpp:43:35: note: Calling '~unique_ptr'
        return msgpack::object_handle();
                                      ^
    /ch/contrib/libcxx/include/__memory/unique_ptr.h:269:19: note: Calling 'unique_ptr::reset'
      ~unique_ptr() { reset(); }
                      ^~~~~~~
    /ch/contrib/libcxx/include/__memory/unique_ptr.h:314:9: note: '__tmp' is non-null
        if (__tmp)
            ^~~~~
    /ch/contrib/libcxx/include/__memory/unique_ptr.h:314:5: note: Taking true branch
        if (__tmp)
        ^
    /ch/contrib/libcxx/include/__memory/unique_ptr.h:315:7: note: Calling 'default_delete::operator()'
          __ptr_.second()(__tmp);
          ^~~~~~~~~~~~~~~~~~~~~~
    /ch/contrib/libcxx/include/__memory/unique_ptr.h:54:5: note: Memory is released
        delete __ptr;
        ^~~~~~~~~~~~
    /ch/contrib/libcxx/include/__memory/unique_ptr.h:54:5: note: Calling 'zone::operator delete'
        delete __ptr;
        ^~~~~~~~~~~~
    /ch/contrib/msgpack-c/include/msgpack/v1/detail/cpp11_zone.hpp:195:9: note: Attempt to free released memory
            ::free(p);
            ^~~~~~~~~

  [1]: https://s3.amazonaws.com/clickhouse-builds/41046/9677898b3b234a5ba0371edaf719ea8890d084ff/binary_tidy/build_log.log

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-09-10 21:38:35 +02:00
Azat Khuzhin
4e3135383b Fix clang-tidy warnings (from clang-15)
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-09-10 21:38:35 +02:00
Azat Khuzhin
ba4174402a Temporary disable complation of compileAddIntoAggregateStatesFunctions
Fixes the following use-of-uninitialized-value in llvm [1]:

    ==696==WARNING: MemorySanitizer: use-of-uninitialized-value
        0 0x498141d9 in llvm::ilist_traits<llvm::MachineInstr>::removeNodeFromList(llvm::MachineInstr*) build_docker/../contrib/llvm/llvm/lib/CodeGen/MachineBasicBlock.cpp:155:24
        1 0x498141d9 in llvm::iplist_impl<llvm::simple_ilist<llvm::MachineInstr, llvm::ilist_sentinel_tracking<true>>, llvm::ilist_traits<llvm::MachineInstr>>::remove(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>, false, false>&) build_docker/../contrib/llvm/llvm/include/llvm/ADT/ilist.h:253:11
        2 0x498141d9 in llvm::iplist_impl<llvm::simple_ilist<llvm::MachineInstr, llvm::ilist_sentinel_tracking<true>>, llvm::ilist_traits<llvm::MachineInstr>>::erase(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>, false, false>) build_docker/../contrib/llvm/llvm/include/llvm/ADT/ilist.h:268:22
        3 0x498141d9 in llvm::iplist_impl<llvm::simple_ilist<llvm::MachineInstr, llvm::ilist_sentinel_tracking<true>>, llvm::ilist_traits<llvm::MachineInstr>>::erase(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>, false, false>, llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>, false, false>) build_docker/../contrib/llvm/llvm/include/llvm/ADT/ilist.h:305:15
        4 0x498141d9 in llvm::iplist_impl<llvm::simple_ilist<llvm::MachineInstr, llvm::ilist_sentinel_tracking<true>>, llvm::ilist_traits<llvm::MachineInstr>>::clear() build_docker/../contrib/llvm/llvm/include/llvm/ADT/ilist.h:309:18
        5 0x498141d9 in llvm::iplist_impl<llvm::simple_ilist<llvm::MachineInstr, llvm::ilist_sentinel_tracking<true>>, llvm::ilist_traits<llvm::MachineInstr>>::~iplist_impl() build_docker/../contrib/llvm/llvm/include/llvm/ADT/ilist.h:210:20
        6 0x498145ff in llvm::MachineBasicBlock::~MachineBasicBlock() build_docker/../contrib/llvm/llvm/lib/CodeGen/MachineBasicBlock.cpp:56:1
        7 0x49969c1f in llvm::MachineFunction::DeleteMachineBasicBlock(llvm::MachineBasicBlock*) build_docker/../contrib/llvm/llvm/lib/CodeGen/MachineFunction.cpp:426:8
        8 0x49969c1f in llvm::ilist_alloc_traits<llvm::MachineBasicBlock>::deleteNode(llvm::MachineBasicBlock*) build_docker/../contrib/llvm/llvm/lib/CodeGen/MachineFunction.cpp:127:21
        9 0x4983f4d6 in llvm::iplist_impl<llvm::simple_ilist<llvm::MachineBasicBlock>, llvm::ilist_traits<llvm::MachineBasicBlock>>::erase(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineBasicBlock, false, false, void>, false, false>) build_docker/../contrib/llvm/llvm/include/llvm/ADT/ilist.h:268:11
        10 0x4983f4d6 in llvm::iplist_impl<llvm::simple_ilist<llvm::MachineBasicBlock>, llvm::ilist_traits<llvm::MachineBasicBlock>>::erase(llvm::MachineBasicBlock*) build_docker/../contrib/llvm/llvm/include/llvm/ADT/ilist.h:272:39
        11 0x4983f4d6 in llvm::MachineFunction::erase(llvm::MachineBasicBlock*) build_docker/../contrib/llvm/llvm/include/llvm/CodeGen/MachineFunction.h:767:53
        12 0x4983f4d6 in llvm::MachineBasicBlock::eraseFromParent() build_docker/../contrib/llvm/llvm/lib/CodeGen/MachineBasicBlock.cpp:1317:16
        13 0x4a0c9a27 in llvm::TailDuplicator::removeDeadBlock(llvm::MachineBasicBlock*, llvm::function_ref<void (llvm::MachineBasicBlock*)>*) build_docker/../contrib/llvm/llvm/lib/CodeGen/TailDuplicator.cpp:1051:8
        14 0x4a0c1e41 in llvm::TailDuplicator::tailDuplicateAndUpdate(bool, llvm::MachineBasicBlock*, llvm::MachineBasicBlock*, llvm::SmallVectorImpl<llvm::MachineBasicBlock*>*, llvm::function_ref<void (llvm::MachineBasicBlock*)>*, llvm::SmallVectorImpl<llvm::MachineBasicBlock*>*) build_docker/../contrib/llvm/llvm/lib/CodeGen/TailDuplicator.cpp:189:5
        15 0x4a0ca16e in llvm::TailDuplicator::tailDuplicateBlocks() build_docker/../contrib/llvm/llvm/lib/CodeGen/TailDuplicator.cpp:288:19
        16 0x4a0be9f9 in (anonymous namespace)::TailDuplicateBase::runOnMachineFunction(llvm::MachineFunction&) build_docker/../contrib/llvm/llvm/lib/CodeGen/TailDuplication.cpp:98:21
        17 0x499a2777 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) build_docker/../contrib/llvm/llvm/lib/CodeGen/MachineFunctionPass.cpp:72:13
        18 0x4dbba34d in llvm::FPPassManager::runOnFunction(llvm::Function&) build_docker/../contrib/llvm/llvm/lib/IR/LegacyPassManager.cpp:1435:27
        19 0x4dbe3761 in llvm::FPPassManager::runOnModule(llvm::Module&) build_docker/../contrib/llvm/llvm/lib/IR/LegacyPassManager.cpp:1481:16
        20 0x4dbbebbb in (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) build_docker/../contrib/llvm/llvm/lib/IR/LegacyPassManager.cpp:1550:27
        21 0x4dbbebbb in llvm::legacy::PassManagerImpl::run(llvm::Module&) build_docker/../contrib/llvm/llvm/lib/IR/LegacyPassManager.cpp:541:44
        22 0x4dbe454b in llvm::legacy::PassManager::run(llvm::Module&) build_docker/../contrib/llvm/llvm/lib/IR/LegacyPassManager.cpp:1677:14
        23 0x414405df in DB::JITCompiler::compile(llvm::Module&) build_docker/../src/Interpreters/JIT/CHJIT.cpp:78:22
        24 0x4143bb7d in DB::CHJIT::compileModule(std::__1::unique_ptr<llvm::Module, std::__1::default_delete<llvm::Module>>) build_docker/../src/Interpreters/JIT/CHJIT.cpp:378:29
        25 0x4143aded in DB::CHJIT::compileModule(std::__1::function<void (llvm::Module&)>) build_docker/../src/Interpreters/JIT/CHJIT.cpp:359:24
        26 0x4147b25e in DB::compileAggregateFunctions(DB::CHJIT&, std::__1::vector<DB::AggregateFunctionWithOffset, std::__1::allocator<DB::AggregateFunctionWithOffset>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>) build_docker/../src/Interpreters/JIT/compileFunction.cpp:738:32
        27 0x3de0a23a in DB::Aggregator::compileAggregateFunctionsIfNeeded()::$_0::operator()() const build_docker/../src/Interpreters/Aggregator.cpp:661:49
        28 0x3de0a23a in std::__1::pair<std::__1::shared_ptr<DB::CompiledExpressionCacheEntry>, bool> DB::CacheBase<wide::integer<128ul, unsigned int>, DB::CompiledExpressionCacheEntry, UInt128Hash, DB::CompiledFunctionWeightFunction>::getOrSet<DB::Aggregator::compileAggregateFunctionsIfNeeded()::$_0>(wide::integer<128ul, unsigned int> const&, DB::Aggregator::compileAggregateFunctionsIfNeeded()::$_0&&) build_docker/../src/Common/CacheBase.h:125:24
        29 0x3de0a23a in DB::Aggregator::compileAggregateFunctionsIfNeeded() build_docker/../src/Interpreters/Aggregator.cpp:657:70

      Memory was marked as uninitialized
        0 0xb988ded in __sanitizer_dtor_callback (/usr/bin/clickhouse+0xb988ded) (BuildId: c4a880b742797a1f37bc4f5ed869f055cc86486b)
        1 0x498145da in llvm::MachineBasicBlock::~MachineBasicBlock() build_docker/../contrib/llvm/llvm/lib/CodeGen/MachineBasicBlock.cpp:56:1
        2 0x49969c1f in llvm::MachineFunction::DeleteMachineBasicBlock(llvm::MachineBasicBlock*) build_docker/../contrib/llvm/llvm/lib/CodeGen/MachineFunction.cpp:426:8
        3 0x49969c1f in llvm::ilist_alloc_traits<llvm::MachineBasicBlock>::deleteNode(llvm::MachineBasicBlock*) build_docker/../contrib/llvm/llvm/lib/CodeGen/MachineFunction.cpp:127:21
        4 0x4983f4d6 in llvm::iplist_impl<llvm::simple_ilist<llvm::MachineBasicBlock>, llvm::ilist_traits<llvm::MachineBasicBlock>>::erase(llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineBasicBlock, false, false, void>, false, false>) build_docker/../contrib/llvm/llvm/include/llvm/ADT/ilist.h:268:11
        5 0x4983f4d6 in llvm::iplist_impl<llvm::simple_ilist<llvm::MachineBasicBlock>, llvm::ilist_traits<llvm::MachineBasicBlock>>::erase(llvm::MachineBasicBlock*) build_docker/../contrib/llvm/llvm/include/llvm/ADT/ilist.h:272:39
        6 0x4983f4d6 in llvm::MachineFunction::erase(llvm::MachineBasicBlock*) build_docker/../contrib/llvm/llvm/include/llvm/CodeGen/MachineFunction.h:767:53
        7 0x4983f4d6 in llvm::MachineBasicBlock::eraseFromParent() build_docker/../contrib/llvm/llvm/lib/CodeGen/MachineBasicBlock.cpp:1317:16
        8 0x4a0c9a27 in llvm::TailDuplicator::removeDeadBlock(llvm::MachineBasicBlock*, llvm::function_ref<void (llvm::MachineBasicBlock*)>*) build_docker/../contrib/llvm/llvm/lib/CodeGen/TailDuplicator.cpp:1051:8
        9 0x4a0c1e41 in llvm::TailDuplicator::tailDuplicateAndUpdate(bool, llvm::MachineBasicBlock*, llvm::MachineBasicBlock*, llvm::SmallVectorImpl<llvm::MachineBasicBlock*>*, llvm::function_ref<void (llvm::MachineBasicBlock*)>*, llvm::SmallVectorImpl<llvm::MachineBasicBlock*>*) build_docker/../contrib/llvm/llvm/lib/CodeGen/TailDuplicator.cpp:189:5
        10 0x4a0ca16e in llvm::TailDuplicator::tailDuplicateBlocks() build_docker/../contrib/llvm/llvm/lib/CodeGen/TailDuplicator.cpp:288:19
        11 0x4a0be9f9 in (anonymous namespace)::TailDuplicateBase::runOnMachineFunction(llvm::MachineFunction&) build_docker/../contrib/llvm/llvm/lib/CodeGen/TailDuplication.cpp:98:21
        12 0x499a2777 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) build_docker/../contrib/llvm/llvm/lib/CodeGen/MachineFunctionPass.cpp:72:13
        13 0x4dbba34d in llvm::FPPassManager::runOnFunction(llvm::Function&) build_docker/../contrib/llvm/llvm/lib/IR/LegacyPassManager.cpp:1435:27
        14 0x4dbe3761 in llvm::FPPassManager::runOnModule(llvm::Module&) build_docker/../contrib/llvm/llvm/lib/IR/LegacyPassManager.cpp:1481:16
        15 0x4dbbebbb in (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) build_docker/../contrib/llvm/llvm/lib/IR/LegacyPassManager.cpp:1550:27
        16 0x4dbbebbb in llvm::legacy::PassManagerImpl::run(llvm::Module&) build_docker/../contrib/llvm/llvm/lib/IR/LegacyPassManager.cpp:541:44
        17 0x4dbe454b in llvm::legacy::PassManager::run(llvm::Module&) build_docker/../contrib/llvm/llvm/lib/IR/LegacyPassManager.cpp:1677:14
        18 0x414405df in DB::JITCompiler::compile(llvm::Module&) build_docker/../src/Interpreters/JIT/CHJIT.cpp:78:22
        19 0x4143bb7d in DB::CHJIT::compileModule(std::__1::unique_ptr<llvm::Module, std::__1::default_delete<llvm::Module>>) build_docker/../src/Interpreters/JIT/CHJIT.cpp:378:29
        20 0x4143aded in DB::CHJIT::compileModule(std::__1::function<void (llvm::Module&)>) build_docker/../src/Interpreters/JIT/CHJIT.cpp:359:24
        21 0x4147b25e in DB::compileAggregateFunctions(DB::CHJIT&, std::__1::vector<DB::AggregateFunctionWithOffset, std::__1::allocator<DB::AggregateFunctionWithOffset>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>) build_docker/../src/Interpreters/JIT/compileFunction.cpp:738:32
        22 0x3de0a23a in DB::Aggregator::compileAggregateFunctionsIfNeeded()::$_0::operator()() const build_docker/../src/Interpreters/Aggregator.cpp:661:49
        23 0x3de0a23a in std::__1::pair<std::__1::shared_ptr<DB::CompiledExpressionCacheEntry>, bool> DB::CacheBase<wide::integer<128ul, unsigned int>, DB::CompiledExpressionCacheEntry, UInt128Hash, DB::CompiledFunctionWeightFunction>::getOrSet<DB::Aggregator::compileAggregateFunctionsIfNeeded()::$_0>(wide::integer<128ul, unsigned int> const&, DB::Aggregator::compileAggregateFunctionsIfNeeded()::$_0&&) build_docker/../src/Common/CacheBase.h:125:24
        24 0x3de0a23a in DB::Aggregator::compileAggregateFunctionsIfNeeded() build_docker/../src/Interpreters/Aggregator.cpp:657:70

  [1]: https://s3.amazonaws.com/clickhouse-test-reports/41046/490a2c75610c4bc3191d55226f8454b3c3d3919a/stateful_tests__msan_.html

Note, that it is safe to do, but only for this method, since it had been
disabled anyway, back in #27574, and I guess this MSan report may be
related.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-09-10 21:38:35 +02:00
Azat Khuzhin
e0a8f19cfb Fix -Wzero-as-null-pointer-constant in MemoryStatisticsOS::get for FreeBSD
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-09-10 21:38:35 +02:00
Azat Khuzhin
e8d7403a38 Suppress warning in FormatFactory::getFormatFromFileDescriptor() for FreeBSD
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-09-10 21:38:35 +02:00
Alexey Milovidov
871ee15a9c
Merge pull request #40953 from ClibMouse/sensitive_data_masker_unittest_issue
Rearrange sensitive data masker unit test
2022-09-10 20:03:30 +03:00
Alexey Milovidov
89bae332a0
Merge pull request #41170 from ClickHouse/fix-weird-lowcardinality
Fix something terribly wrong in LowCardinality
2022-09-10 18:08:35 +03:00
Kruglov Pavel
2ca5846595
Merge pull request #41159 from azat/load-balancing-fix
Fix stack-use-after-return in GetPriorityForLoadBalancing::getPriorityFunc()
2022-09-10 15:11:31 +02:00
Alexey Milovidov
61278c81e4 Merge branch 'master' into remove-useless-line 2022-09-10 05:07:10 +02:00
Alexey Milovidov
fd235919aa Remove some methods 2022-09-10 05:04:40 +02:00
Suzy Wang
d60340eb40
Merge branch 'master' into sensitive_data_masker_unittest_issue 2022-09-09 22:59:50 -04:00
Alexey Milovidov
fa62c7e982 Fix half of trash 2022-09-10 04:08:16 +02:00
Alexey Milovidov
daff201566 Fix something terribly wrong in LowCardinality 2022-09-10 03:28:37 +02:00
Alexey Milovidov
4301b362ab Fix strange code in DatabaseReplicated 2022-09-10 02:34:37 +02:00
Igor Nikonov
726639484a
Revert "Query plan optimization setting: read in window order" 2022-09-09 22:15:38 +02:00
avogar
d8cbd51333 Support relative path in Location header after http redirect 2022-09-09 19:26:14 +00:00
Azat Khuzhin
8c5583d7a5 Fix stack-use-after-return in GetPriorityForLoadBalancing::getPriorityFunc()
clang-15 reports [1]:

<details>

<summary>ASan report</summary>

```
    ==1==ERROR: AddressSanitizer: stack-use-after-return on address 0x7f1d04c4eb20 at pc 0x000031c4803c bp 0x7f1d05e19a00 sp 0x7f1d05e199f8
    READ of size 8 at 0x7f1d04c4eb20 thread T200 (QueryPullPipeEx)
        #0 0x31c4803b in DB::GetPriorityForLoadBalancing::getPriorityFunc(DB::LoadBalancing, unsigned long, unsigned long) const::$_3::operator()(unsigned long) const build_docker/../src/Common/GetPriorityForLoadBalancing.cpp:42:40
        #1 0x31c4803b in decltype(static_cast<DB::GetPriorityForLoadBalancing::getPriorityFunc(DB::LoadBalancing, unsigned long, unsigned long) const::$_3&>(fp)(static_cast<unsigned long>(fp0))) std::__1::__invoke<DB::GetPriorityForLoadBalancing::getPriorityFunc(DB::LoadBalancing, unsigned long, unsigned long) const::$_3&, unsigned long>(DB::GetPriorityForLoadBalancing::getPriorityFunc(DB::LoadBalancing, unsigned long, unsigned long) const::$_3&, unsigned long&&) build_docker/../contrib/libcxx/include/type_traits:3640:23
        #2 0x31c4803b in unsigned long std::__1::__invoke_void_return_wrapper<unsigned long, false>::__call<DB::GetPriorityForLoadBalancing::getPriorityFunc(DB::LoadBalancing, unsigned long, unsigned long) const::$_3&, unsigned long>(DB::GetPriorityForLoadBalancing::getPriorityFunc(DB::LoadBalancing, unsigned long, unsigned long) const::$_3&, unsigned long&&) build_docker/../contrib/libcxx/include/__functional/invoke.h:30:16
        #3 0x31c4803b in std::__1::__function::__default_alloc_func<DB::GetPriorityForLoadBalancing::getPriorityFunc(DB::LoadBalancing, unsigned long, unsigned long) const::$_3, unsigned long (unsigned long)>::operator()(unsigned long&&) build_docker/../contrib/libcxx/include/__functional/function.h:230:12
        #4 0x31c4803b in unsigned long std::__1::__function::__policy_invoker<unsigned long (unsigned long)>::__call_impl<std::__1::__function::__default_alloc_func<DB::GetPriorityForLoadBalancing::getPriorityFunc(DB::LoadBalancing, unsigned long, unsigned long) const::$_3, unsigned long (unsigned long)>>(std::__1::__function::__policy_storage const*, unsigned long) build_docker/../contrib/libcxx/include/__functional/function.h:711:16
        #5 0x31c38b07 in std::__1::__function::__policy_func<unsigned long (unsigned long)>::operator()(unsigned long&&) const build_docker/../contrib/libcxx/include/__functional/function.h:843:16
        #6 0x31c38b07 in std::__1::function<unsigned long (unsigned long)>::operator()(unsigned long) const build_docker/../contrib/libcxx/include/__functional/function.h:1184:12
        #7 0x31c38b07 in PoolWithFailoverBase<DB::IConnectionPool>::getShuffledPools(unsigned long, std::__1::function<unsigned long (unsigned long)> const&) build_docker/../src/Common/PoolWithFailoverBase.h:174:39

      This frame has 2 object(s):
        [32, 40) 'pool_size.addr' <== Memory access at offset 32 is inside this variable
        [64, 88) 'ref.tmp' (line 18)
```

</details>

  [1]: https://s3.amazonaws.com/clickhouse-test-reports/41046/adea92f847373d1fcfd733d8979c63024f9b80bf/integration_tests__asan__[1/3].html

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-09-09 20:06:48 +02:00
Denny Crane
be90cecbd2 Revert "Revert "Fix trivial count optimization with array join""
This reverts commit 17de7b2876.
2022-09-09 14:56:38 -03:00
Azat Khuzhin
763bb18f98 Fix SIGSEGV in SortedBlocksWriter in case of empty block
CI found one issue [1].

Here is the stack trace for invalid read:

<details>

<summary>stack trace</summary>

```
    0: DB::TemporaryFileLazySource::TemporaryFileLazySource(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Block const&) [inlined] std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__is_long(this="") const at string:1445:22
    1: DB::TemporaryFileLazySource::TemporaryFileLazySource(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Block const&) [inlined] std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(this="", __str="") at string:1927
    2: DB::TemporaryFileLazySource::TemporaryFileLazySource(this=0x00007f3aec105f58, path_="", header_=0x00007f38ffd93b40) at TemporaryFileLazySource.cpp:11
    3: DB::SortedBlocksWriter::streamFromFile(std::__1::unique_ptr<Poco::TemporaryFile, std::__1::default_delete<Poco::TemporaryFile> > const&) const [inlined] DB::TemporaryFileLazySource* std::__1::construct_at<DB::TemporaryFileLazySource, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Block, DB::TemporaryFileLazySource*>(__args=0x00007f38ffd91560) at construct_at.h:38:50
    4: DB::SortedBlocksWriter::streamFromFile(std::__1::unique_ptr<Poco::TemporaryFile, std::__1::default_delete<Poco::TemporaryFile> > const&) const [inlined] void std::__1::allocator_traits<std::__1::allocator<DB::TemporaryFileLazySource> >::construct<DB::TemporaryFileLazySource, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Block, void, void>(__args=0x00007f38ffd91560) at allocator_traits.h:298
    5: DB::SortedBlocksWriter::streamFromFile(std::__1::unique_ptr<Poco::TemporaryFile, std::__1::default_delete<Poco::TemporaryFile> > const&) const [inlined] std::__1::__shared_ptr_emplace<DB::TemporaryFileLazySource, std::__1::allocator<DB::TemporaryFileLazySource> >::__shared_ptr_emplace<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Block>(this=0x00007f3aec105f40, __args=0x00007f38ffd91560) at shared_ptr.h:293
    6: DB::SortedBlocksWriter::streamFromFile(std::__1::unique_ptr<Poco::TemporaryFile, std::__1::default_delete<Poco::TemporaryFile> > const&) const [inlined] std::__1::shared_ptr<DB::TemporaryFileLazySource> std::__1::allocate_shared<DB::TemporaryFileLazySource, std::__1::allocator<DB::TemporaryFileLazySource>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Block, void>(__args=<unavailable>, __args=<unavailable>) at shared_ptr.h:954
    7: DB::SortedBlocksWriter::streamFromFile(std::__1::unique_ptr<Poco::TemporaryFile, std::__1::default_delete<Poco::TemporaryFile> > const&) const [inlined] std::__1::shared_ptr<DB::TemporaryFileLazySource> std::__1::make_shared<DB::TemporaryFileLazySource, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::Block, void>(__args=<unavailable>, __args=<unavailable>) at shared_ptr.h:963
    8: DB::SortedBlocksWriter::streamFromFile(this=<unavailable>, file=<unavailable>) const at SortedBlocksWriter.cpp:238
    9: DB::SortedBlocksWriter::premerge(this=<unavailable>) at SortedBlocksWriter.cpp:209:32
```

</details>

  [1]: https://s3.amazonaws.com/clickhouse-test-reports/41046/adea92f847373d1fcfd733d8979c63024f9b80bf/stress_test__asan_.html

So the problem here is that there was empty unique_ptr<> reference to
temporary file, because of empty block that accepted by
SortedBlocksWriter::insert(), but insert() is not a problem the problem
is premerge() that steals blocks from insert() and do not have check
that there are some rows. However this check exists in
SortedBlocksWriter::flush(), and in that case temporary file is not
created.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-09-09 19:52:38 +02:00
Azat Khuzhin
57146c9361 Fix typos in SortedBlocksWriter
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-09-09 19:52:38 +02:00
Anton Popov
a1b5582a7c
Merge pull request #37152 from CurtizJ/fix-filling-of-missed-nested
Fix filling of missed Nested columns with multiple levels
2022-09-09 19:29:01 +02:00
Alexander Tokmakov
9bcec2d49a stop background ops before converting db engine 2022-09-09 18:27:19 +02:00
zhenjial
51badf3d0a fix 2022-09-10 00:08:50 +08:00
Dmitry Novik
64c4023737
Merge branch 'master' into grouping-comp 2022-09-09 18:05:01 +02:00
Dmitry Novik
877776e569
Update src/Functions/grouping.h 2022-09-09 18:04:29 +02:00
Kruglov Pavel
c33aa54032
Fix 2022-09-09 17:53:26 +02:00
zhenjial
bd9fabc3f7 code optimization, add test 2022-09-09 23:27:42 +08:00
Nikolay Degterinsky
12e7cd6b19
Merge pull request #41068 from jthmath/bugfix
fix ignore projection logic error
2022-09-09 17:10:03 +02:00
alesapin
86a3719bef
Merge pull request #41128 from ClickHouse/less_errors
Fix bad warnings in part fetches
2022-09-09 16:58:09 +02:00
Roman Vasin
3aa33f39ac Fix ErrorCodes for style check 2022-09-09 14:17:46 +00:00
Roman Vasin
da3e938ad6 Enable Date32 results for toStartOfWeek 2022-09-09 13:45:51 +00:00
Roman Vasin
b03a0a724f Enable Date32 results for toStartOfYear, toStartOfISOYear, toStartOfQuarter, toStartOfMonth, toMonday, toLastDayOfMonth 2022-09-09 13:25:52 +00:00
Alexander Tokmakov
98509e62e8
Update src/Storages/Freeze.cpp 2022-09-09 16:20:24 +03:00
Kseniia Sumarokova
5bb40e5856
Change cache setting do_not_evict_index_and_mark_files default to 0. (#41139) 2022-09-09 15:04:32 +02:00
Antonio Andelic
32483aeec8 Merge branch 'master' into keeper-storage 2022-09-09 12:24:01 +00:00
kssenii
5cba9b789c Merge remote-tracking branch 'upstream/master' into refactor-cache-for-async-download 2022-09-09 14:14:04 +02:00
Sergei Trifonov
76eb001e78 add test for changeable_in_readonly + fix SQL in docs 2022-09-09 14:01:29 +02:00
Igor Nikonov
5379f37331
Merge pull request #41015 from ClickHouse/window_func_optimization_setting
Query plan optimization setting: read in window order
2022-09-09 14:00:41 +02:00
Raúl Marín
b33c1fa60f Fix query_views_log with Window views 2022-09-09 13:46:53 +02:00
alesapin
01e745bbbf Fix parts removal 2022-09-09 13:26:13 +02:00
Alexander Tokmakov
48927ba0ac
Merge branch 'master' into no-hardlinks-while-making-backup-of-mergetree-in-atomic-db 2022-09-09 14:24:44 +03:00
alesapin
23d95e6723 Fix parts removal in case of failures 2022-09-09 13:24:22 +02:00
kssenii
c2c35278ba Refactor cache for async download 2022-09-09 13:12:47 +02:00
alesapin
e3fc78aa5f Fix bad warnings in part fetches 2022-09-09 12:14:42 +02:00
Antonio Andelic
8ae7fb14b3
Merge pull request #40918 from ClickHouse/fix-keeper-system-path-check
Fix check for Keeper system path modification
2022-09-09 09:12:49 +02:00
lthaooo
d4dd6b05b2 optimize compact part mutation 2022-09-09 10:22:35 +08:00
Dmitry Novik
323fdeff0b
Merge branch 'master' into fix-odr-vialation 2022-09-09 00:42:14 +02:00
Alexey Milovidov
af8ed9c166
Merge branch 'master' into sensitive_data_masker_unittest_issue 2022-09-09 00:05:53 +03:00
Dmitry Novik
29b5d023ee Replace WITH_TEXT_LOG by WITHOUT_TEXT_LOG 2022-09-08 19:16:37 +02:00
zhenjial
469ceaa156 code optimization 2022-09-09 00:47:43 +08:00
Vitaly Baranov
9acc73d811
Update src/Storages/StorageReplicatedMergeTree.cpp
Co-authored-by: Alexander Tokmakov <tavplubix@gmail.com>
2022-09-08 17:51:29 +02:00
Sergei Trifonov
f92b6a6176
Merge branch 'master' into readonly-settings-allow 2022-09-08 17:44:32 +02:00
Sergei Trifonov
62541ab764 fix more tests and clang tidy build 2022-09-08 17:43:09 +02:00
alesapin
62c911924b
Merge pull request #41108 from ClickHouse/more_logging
More logging for S3
2022-09-08 17:10:55 +02:00
alesapin
5e00124f8a More logging for S3 2022-09-08 16:18:21 +02:00
Antonio Andelic
3502718a2c Less complications 2022-09-08 13:52:14 +00:00
Kruglov Pavel
992ba99da4
Add comment 2022-09-08 15:23:29 +02:00
Antonio Andelic
b6f8e06708
Typo fix 2022-09-08 14:57:34 +02:00
Alexander Tokmakov
507ad0c4d9
Merge pull request #40691 from azat/mergetree/transaction-wal-fix
Move committing InMemory parts to WAL out of NOEXCEPT_SCOPE()
2022-09-08 15:55:30 +03:00
Antonio Andelic
b99996961d Address PR comments 2022-09-08 12:45:36 +00:00
vdimir
8121904dc4
Minor update StorageEmbeddedRocksDB::getSampleBlock 2022-09-08 12:43:38 +00:00
alesapin
15dc68340f
Merge pull request #41103 from ClickHouse/return_key_to_message
Improve logging one time
2022-09-08 14:00:06 +02:00
Vitaly Baranov
122009a2bd Use table lock if database is ordinary and zero-copy-replication is enabled. 2022-09-08 13:54:59 +02:00
Kruglov Pavel
04aea19b31
Merge pull request #40881 from coelho/patch-1
Fix uncaught DNS_ERROR on failed connection to replicas
2022-09-08 13:32:45 +02:00
Maksim Kita
1f9ea15aab
Merge pull request #41049 from canhld94/ch_canh_gs_core
Remove parser logic for WITH GROUPING SETS
2022-09-08 13:32:27 +02:00
Kruglov Pavel
96cb0e54d8
Merge branch 'master' into Avogar-patch-1 2022-09-08 13:24:08 +02:00
Kruglov Pavel
93d38b9451
Fix style 2022-09-08 13:19:18 +02:00
alesapin
6da37b92e1 Improve logging one time 2022-09-08 13:11:53 +02:00
Vladimir C
90647cb0c5
Merge pull request #39970 from SachinSetiya/majority_quorum
Add majority_insert_quorum setting
2022-09-08 11:31:33 +02:00
Frank Chen
a986380522
Update src/Storages/Distributed/DirectoryMonitor.cpp
Co-authored-by: Azat Khuzhin <a3at.mail@gmail.com>
2022-09-08 17:25:29 +08:00
Robert Schulze
c16707ff00
chore: delete obsolete modelEvaluate() function + SYSTEM.MODELS view
- The deleted function modelEvaluate() was superseded by
  catboostEvaluate().

- Also delete the external model repository, as modelEvaluate() was it's
  last user. Additionally remove the system view SYSTEM.MODELS for
  inspecting the repository.

- SYSTEM RELOAD MODELS is also obsolete. HOWEVER, it was retained and
  made a no-op instead of deleted.

  Why?
  The reason is that RBAC in distributed setups works by storing
  privileges (granted and revoked) as plain SQL statements in Keeper.
  Nodes read these statements at startup and parse them. If a privilege
  for SYSTEM RELOAD MODELS exists but parser doesn't recognize it
  nodes would fail to come up.

  Considered but rejected alternatives:
  - Ignore SYSTEM RELOAD MODELS during parsing RBAC privileges and
    return an error for regular SYSTEM RELOAD MODELS SQL. Special-case
    of no-op behavior, too brittle.
  - Remove SYSTEM RELOAD MODELS manually from Keeper via command-line
    manipulation of Keeper nodes or via SQL by dropping the privileges.
    Needs user intervention during upgrade.
2022-09-08 09:10:11 +00:00
Robert Schulze
60f9f6855d
feat: implement catboost in library-bridge
This commit moves the catboost model evaluation out of the server
process into the library-bridge binary. This serves two goals: On the
one hand, crashes / memory corruptions of the catboost library no longer
affect the server. On the other hand, we can forbid loading dynamic
libraries in the server (catboost was the last consumer of this
functionality), thus improving security.

SQL syntax:

  SELECT
    catboostEvaluate('/path/to/model.bin', FEAT_1, ..., FEAT_N) > 0 AS prediction,
    ACTION AS target
  FROM amazon_train
  LIMIT 10

Required configuration:

  <catboost_lib_path>/path/to/libcatboostmodel.so</catboost_lib_path>

*** Implementation Details ***

The internal protocol between the server and the library-bridge is
simple:

- HTTP GET on path "/extdict_ping":
  A ping, used during the handshake to check if the library-bridge runs.

- HTTP POST on path "extdict_request"
  (1) Send a "catboost_GetTreeCount" request from the server to the
      bridge, containing a library path (e.g /home/user/libcatboost.so) and
      a model path (e.g. /home/user/model.bin). Rirst, this unloads the
      catboost library handler associated to the model path (if it was
      loaded), then loads the catboost library handler associated to the
      model path, then executes GetTreeCount() on the library handler and
      finally sends the result back to the server. Step (1) is called once
      by the server from FunctionCatBoostEvaluate::getReturnTypeImpl(). The
      library path handler is unloaded in the beginning because it contains
      state which may no longer be valid if the user runs
      catboost("/path/to/model.bin", ...) more than once and if "model.bin"
      was updated in between.
  (2) Send "catboost_Evaluate" from the server to the bridge, containing
      the model path and the features to run the interference on. Step (2)
      is called multiple times (once per chunk) by the server from function
      FunctionCatBoostEvaluate::executeImpl(). The library handler for the
      given model path is expected to be already loaded by Step (1).

Fixes #27870
2022-09-08 09:01:32 +00:00
Antonio Andelic
09c0bf2931 Add unit tests for match path 2022-09-08 08:16:38 +00:00
Antonio Andelic
5d837e4f41 Merge branch 'master' into fix-keeper-system-path-check 2022-09-08 07:41:04 +00:00
Robert Schulze
68808858a5
Merge pull request #41050 from FrankChen021/exception_safe
Fix failed stress test (OpenTelemetry)
2022-09-08 09:19:54 +02:00
Robert Schulze
9d4de0cbaa
Merge pull request #40999 from ClickHouse/sse2-special-build
Add special x86-SSE2-only build
2022-09-08 09:06:29 +02:00
Frank Chen
329f31e7ab Address review comments
Signed-off-by: Frank Chen <frank.chen021@outlook.com>
2022-09-08 11:38:10 +08:00
Anton Popov
7c12b448b8 Merge remote-tracking branch 'upstream/master' into HEAD 2022-09-08 01:52:52 +00:00
Anton Popov
5a790b15b4 try to fix filling of missed Nested columns with multiple levels 2022-09-08 00:20:11 +00:00
Suzy Wang
61b2e1c32c
Merge branch 'master' into sensitive_data_masker_unittest_issue 2022-09-07 16:49:03 -04:00
Igor Nikonov
e74bb00e90 Fix: EXPLAIN PLAN - make settings in SETTING clause effective 2022-09-07 19:11:25 +00:00
avogar
0475eb0b17 Make better 2022-09-07 18:53:22 +00:00
avogar
5c0c19c533 Make generic solution 2022-09-07 18:49:34 +00:00
Kseniia Sumarokova
a270eeef91
Merge pull request #41008 from kssenii/refactor-merge-tree-read
Small refactoring around merge tree readers (get rid of data part ptr)
2022-09-07 18:27:33 +02:00
Dmitry Novik
499e479892
Merge pull request #40873 from azat/build/fix-debug-symbols-quirk
Fix debug symbols
2022-09-07 17:31:35 +02:00
avogar
9da22f7b7c Fix possible use-heap-after-free in -Map combinator 2022-09-07 15:06:56 +00:00
Suzy Wang
e0b8f26839
Merge branch 'master' into sensitive_data_masker_unittest_issue 2022-09-07 10:38:21 -04:00
alesapin
365438d617
Merge pull request #41016 from ClickHouse/one_more_logging
Slightly improve diagnostics and remove assertions
2022-09-07 15:23:17 +02:00
Antonio Andelic
951ee44229 Process read requests with snapshot install 2022-09-07 11:51:56 +00:00
Vitaly Baranov
31ed722572
Merge pull request #41044 from vitlibar/more-conventional-conversion-yaml-to-xmk
More conventional conversion yaml to xml
2022-09-07 13:46:32 +02:00
vdimir
6234d564d1
Fix ReplicatedMergeTreeSink, add more info to logs 2022-09-07 11:19:28 +00:00
vdimir
000ba8a60d
Use insert_qurum = auto instead of majority_insert_quorum 2022-09-07 11:19:27 +00:00
Sachin
ade4337978
Add majority_insert_quorum setting
majority_insert_quorum is defined as (number_of_replicas/2)+1. Insert
will be successful only if majority of quorum have applied it. If
insert_quorum and majority_insert_quorum both are specified, max of
both will be used.
2022-09-07 11:19:24 +00:00
Kruglov Pavel
8513af5c1b
Merge pull request #40638 from azat/mergetree/insert-perf
Do not obtain storage snapshot for each INSERT block (slightly improves performance)
2022-09-07 12:53:09 +02:00
Robert Schulze
c07f234f09
fix: disable ENABLE_MULTITARGET_CODE for SSE2 builds 2022-09-07 10:52:31 +00:00
Antonio Andelic
61398cee80 Merge branch 'master' into keeper-linearizable-reads 2022-09-07 10:25:35 +00:00
Robert Schulze
bf8fed8be8
Revert "fix: don't force-inline SSE3 code into generic code"
This reverts commit d054ffd110.
2022-09-07 09:45:07 +00:00
Vitaly Baranov
9c847ceec9 No hardlinks while making backup of MergeTree in atomic database. 2022-09-07 11:44:50 +02:00
Antonio Andelic
a377a5f1e9 Change assert to LOGICAL_ERROR 2022-09-07 09:24:50 +00:00
Antonio Andelic
4cdf18cc81 Shutdown storage after RAFT 2022-09-07 09:20:47 +00:00
Antonio Andelic
c6b17bd7f9 Don't preprocess if storage finalized 2022-09-07 09:14:03 +00:00
Antonio Andelic
d15fdae8dc
Merge pull request #40853 from ClickHouse/embeddedrocksdb-delete-update-support
Support for `UPDATE` and `DELETE` in `EmbeddedRocksDB`
2022-09-07 11:03:49 +02:00
alesapin
81c98dadd2 Remove redundant change 2022-09-07 11:01:06 +02:00
Frank Chen
fc05b05be3 Fix style and typo
Signed-off-by: Frank Chen <frank.chen021@outlook.com>
2022-09-07 15:14:43 +08:00
Frank Chen
de8f6bdce7 More safe
Signed-off-by: Frank Chen <frank.chen021@outlook.com>
2022-09-07 13:39:12 +08:00
jthmath
478d2ad06a fix ignore projection 2022-09-07 10:23:52 +08:00
Nikolay Degterinsky
981e9dbce2
Merge pull request #40997 from canhld94/ch_canh_fix_grouping_set
Fix grouping set with group_by_use_nulls
2022-09-07 00:08:31 +02:00
alesapin
6ded03c000 Disable fetch shortcut for zero copy replication 2022-09-07 00:00:10 +02:00
Sergei Trifonov
35524d0175 typo 2022-09-06 20:51:33 +02:00
Sergei Trifonov
77ee4c04aa fix stateless tests 2022-09-06 20:28:50 +02:00
Robert Schulze
d054ffd110
fix: don't force-inline SSE3 code into generic code
Force-inlining code compiled for SSE3 into "generic"
(non-platform-specific) code works for standard x86 builds where
everything is compiled with SSE 4.2 (and smaller). It no longer works
if we compile everything only with SSE 2.
2022-09-06 18:23:19 +00:00
Dmitry Novik
b92c383d4b Try to fix ODR for Loggers class 2022-09-06 19:58:31 +02:00
alesapin
43493389b9 Merge branch 'master' into one_more_logging 2022-09-06 19:40:24 +02:00
Anton Popov
9def867795 fix reading of subcolumns from in-memory parts 2022-09-06 17:38:51 +00:00
alesapin
b778b9f37f Improve logging better 2022-09-06 19:25:58 +02:00
alesapin
09e97a6381 Fix style 2022-09-06 18:38:34 +02:00
alesapin
ceed9f418b Return better errors handling 2022-09-06 18:22:44 +02:00
Vitaly Baranov
63e992d52d Edit test configs. 2022-09-06 17:09:26 +02:00
Anton Popov
ce9b76f416 fix Nested in in-memory parts 2022-09-06 15:01:47 +00:00
kssenii
487bc0fba3 Fix heap use after free 2022-09-06 16:50:58 +02:00
Frank Chen
6ced4131ca exception safe
Signed-off-by: Frank Chen <frank.chen021@outlook.com>
2022-09-06 22:11:47 +08:00
Sergei Trifonov
6217559175
Merge branch 'master' into readonly-settings-allow 2022-09-06 16:10:48 +02:00
Kseniia Sumarokova
3558361a05
Merge branch 'master' into refactor-merge-tree-read 2022-09-06 16:00:43 +02:00
Anton Popov
f76c1482bd try to fix filling of missed Nested columns with multiple levels 2022-09-06 13:56:32 +00:00
Duc Canh Le
4fe0457e59
Merge branch 'master' into ch_canh_gs_core 2022-09-06 21:40:02 +08:00
Duc Canh Le
46f281f9ea remove parser logic for WITH GROUPING SETS 2022-09-06 21:36:58 +08:00
Suzy Wang
cc88679a52
Merge branch 'master' into sensitive_data_masker_unittest_issue 2022-09-06 09:36:53 -04:00
Vitaly Baranov
6b55f4dd68 Use pretty-print to output preprocessed configs in readable form. 2022-09-06 15:01:47 +02:00
Vitaly Baranov
e9b75deeba Make conversion YAML->XML more conventional. 2022-09-06 15:01:41 +02:00
alesapin
422b1658eb Review fix 2022-09-06 14:42:48 +02:00
zhenjial
0f788d98f5 new implementation 2022-09-06 20:39:54 +08:00
alesapin
6ea7f1e011 Better exception handling for ReadBufferFromS3 2022-09-06 13:59:55 +02:00
Nikita Taranov
7c4f42d014
Skip empty literals in lz4 decompression (#40142) 2022-09-06 13:58:26 +02:00
Sergei Trifonov
f77809ddbc
Merge pull request #40900 from ClickHouse/s3-detailed-metrics
S3 detailed metrics
2022-09-06 13:20:57 +02:00
zhenjial
3c43b8ac43 just use file to store errors 2022-09-06 17:20:00 +08:00
zhenjial
18db90dcfc Record errors while reading text formats (CSV, TSV). 2022-09-06 17:19:15 +08:00
Frank Chen
2067096035 Optimize span log for SYNC insert 2022-09-06 16:06:30 +08:00
Frank Chen
8365e7bfac Remove extra attribute 2022-09-06 15:41:21 +08:00
Duc Canh Le
6950016b8a fix grouping set with group_by_use_nulls 2022-09-06 09:39:27 +08:00
Alexey Milovidov
59bd94dcf8
Merge pull request #40975 from vitlibar/fix-access-rights-for-describe
Fix access rights for DESCRIBE TABLE
2022-09-06 02:38:34 +03:00
Alexey Milovidov
940a53e519
Merge pull request #40984 from Lucky-Chang/typo_fix
Fix some typos and clang-tidy warnings
2022-09-06 02:37:50 +03:00
Alexey Milovidov
9091995934
Merge pull request #40978 from azat/log-ignore-memory-limits
[RFC] Ignore memory limits while logging
2022-09-06 02:37:16 +03:00
Kseniia Sumarokova
33f541042a
Fix clang tidy 2022-09-06 00:04:50 +02:00
alesapin
8977af5150 Remove some outdated assertions 2022-09-05 22:59:25 +02:00
alesapin
cbcf267f55 One more line of logging in write buffer from S3 2022-09-05 22:54:38 +02:00
Igor Nikonov
7a8b8e7a39 Optimizer setting: read in window order
optimization's setting is checked before applying it, not inside the optimization code
2022-09-05 20:47:11 +00:00
Alexey Milovidov
4c30dbc905
Merge pull request #40968 from ClickHouse/s3-sharding-2
Sharding s3 key names (2)
2022-09-05 22:47:25 +03:00
Alexander Tokmakov
b264be3c63
Merge branch 'master' into zookeeper_client_fault_injection 2022-09-05 22:13:09 +03:00
Kruglov Pavel
cadae5a2f6
Merge pull request #40896 from kssenii/fix-memory-usage-for-remote
Fix extra memory allocation for remote read buffers
2022-09-05 20:38:57 +02:00
kssenii
4c8aa04b73 Revert "Fix"
This reverts commit ec55c90f36.
2022-09-05 20:12:40 +02:00
kssenii
83514fa2ef Refactor 2022-09-05 20:08:22 +02:00
ianton-ru
39e1fc7a0f
Merge branch 'master' into fix-ordinary-system-unfreeze 2022-09-05 17:10:59 +03:00
Anton Ivashkin
15b0b8ff06 Fix FreezeMetaData::load 2022-09-05 17:01:19 +03:00
Sergei Trifonov
1c247308f1
Merge branch 'master' into s3-detailed-metrics 2022-09-05 15:55:41 +02:00
Kseniia Sumarokova
e12858dca5
Merge pull request #36837 from ClickHouse/stress_s3
Trying stress on top of S3
2022-09-05 15:12:55 +02:00
Anton Popov
f11b7499d1
Merge pull request #40592 from azat/inmemory-WAL-cleanup
Remove completely processed WAL files
2022-09-05 14:15:19 +02:00
Alexander Tokmakov
abffd4595e
Merge branch 'master' into zookeeper_client_fault_injection 2022-09-05 15:03:26 +03:00
Kruglov Pavel
582216a3ca
Merge pull request #39919 from pzhdfy/UniqSketch
UniqThetaSketch support set operation such as union/intersect/not
2022-09-05 13:42:14 +02:00
Nikita Mikhaylov
33e530392e
Check grants for databases in case of renaming databases (#40906) 2022-09-05 12:38:44 +02:00
Azat Khuzhin
313747688e Ignore memory limits while logging
Otherwise there can be pretty noisy messages, like here [1]:

    Cannot add message to the log: Code: 241. DB::Exception: Memory limit (for user) exceeded: would use 42.02 MiB (attempt to allocate chunk of 2101278 bytes), maximum: 4.77 MiB. OvercommitTracker decision: Waiting timeout for memory to be freed is reached. (MEMORY_LIMIT_EXCEEDED), Stack trace (when copying this message, always include the lines below):

  [1]: https://s3.amazonaws.com/clickhouse-test-reports/0/efc74e33e580b7d3ff33c3e269db86addfaa6b51/stateless_tests__msan__[2/3].html

And it should be okay to ignore server limits too, since it always
better to have a proper log message in a proper place, not stderr which
does not inspected usually.

Follow-up for: #24069
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-09-05 12:20:15 +02:00
Igor Nikonov
025c7a1ae0
Merge pull request #40305 from ClickHouse/sort_mode_rename
Sorting mode renaming
2022-09-05 11:59:35 +02:00
Kseniia Sumarokova
64168da410
Merge pull request #40950 from kssenii/fix-races-in-write-buffer-from-s3
Fix race in WriteBufferFromS3, add TSA annotations
2022-09-05 11:58:42 +02:00
Antonio Andelic
e07539d1b9 Merge branch 'master' into keeper-storage 2022-09-05 09:54:13 +00:00
Frank Chen
6ab1549d6c Update writeToLocal to record related info 2022-09-05 16:40:48 +08:00
Frank Chen
a17bc51d5b Save cluster/distributed/table to log 2022-09-05 16:39:47 +08:00
Frank Chen
3d65e3f2ee Add cluster/distributed/remote to file 2022-09-05 16:37:55 +08:00
Antonio Andelic
f0ba3ee927
Fix typo 2022-09-05 09:51:02 +02:00
Antonio Andelic
3a0581e990
Merge pull request #40543 from Lloyd-Pottiger/feat/support-read-only-for-embeddedrocksdb
Add read-only support for EmbeddedRocksDB
2022-09-05 09:31:07 +02:00
Antonio Andelic
110ad53300 Merge branch 'master' into keeper-linearizable-reads 2022-09-05 07:12:45 +00:00
Antonio Andelic
569f0abfb7 Change error code 2022-09-05 07:03:23 +00:00
Luck-Chang
0800c0fd4c fix some typos 2022-09-05 14:09:42 +08:00
Alexey Milovidov
1364685eff
Merge branch 'master' into s3-sharding-2 2022-09-05 08:39:19 +03:00
Luck-Chang
1ac8e739c9 fix some typos and clang-tidy warnings 2022-09-05 09:50:24 +08:00
Alexey Milovidov
bff96b0af6
Merge branch 'master' into fix-access-rights-for-describe 2022-09-05 04:34:57 +03:00
Alexey Milovidov
79e3723272 Merge branch 'master' into s3-sharding-2 2022-09-05 02:24:35 +02:00
Alexey Milovidov
d20d49f39f
Merge pull request #40958 from arenadata/ADQM-566
stylecheck renewed and version in docker set explicitely
2022-09-05 03:23:38 +03:00
alesapin
45b1f9dc41
Merge branch 'master' into stress_s3 2022-09-04 23:17:10 +02:00
Igor Nikonov
8fece1e2d2
Merge branch 'master' into sort_mode_rename 2022-09-04 21:44:33 +02:00
kssenii
48dc32faf8 Better test 2022-09-04 19:54:34 +02:00
kssenii
e2df4b1da1 Merge remote-tracking branch 'origin/fix-races-in-write-buffer-from-s3' into fix-races-in-write-buffer-from-s3 2022-09-04 19:50:19 +02:00
kssenii
52375d2eb0 Merge master 2022-09-04 19:48:04 +02:00
Vitaly Baranov
cfb250c46b Fix checking access rights for DESCRIBE TABLE url. 2022-09-04 18:58:39 +02:00
Nikita Taranov
16af4aebc8
impl (#40952) 2022-09-04 16:26:31 +02:00
Azat Khuzhin
2e85f9f0ad Remove completely processed WAL files
Previously all WAL files had been stored, though with the time of use
this can take too much space on disk, and also the startup time will be
increased.

But it is pretty easy to prune old WAL files (the one parts from which
had been completely written to disk already).

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-09-04 14:18:14 +02:00
Kseniia Sumarokova
5f757be43d
Merge pull request #40943 from kssenii/fix-deadlock-in-s3-write-buffer
Fix deadlock in WriteBufferFromS3
2022-09-04 13:17:41 +02:00
alesapin
a67703b76b
Merge branch 'master' into stress_s3 2022-09-04 13:00:28 +02:00
Alexey Milovidov
712de53033 Sharding s3 key names 2022-09-04 04:15:45 +02:00
Alexey Milovidov
193cd1b3b2
Merge pull request #39138 from nickitat/control_block_size_in_aggregator
Control block size in aggregator
2022-09-04 04:51:00 +03:00
Alexey Milovidov
dbca269ec7
Merge pull request #40321 from azat/mem/untracked_memory_limit_increase
Remove ThreadStatus::untracked_memory_limit_increase
2022-09-04 04:42:24 +03:00
Alexey Milovidov
660c1439ec Fix build 2022-09-04 03:27:55 +02:00
Alexey Milovidov
13a129bee7 Merge branch 'master' into remove-useless-line 2022-09-04 03:24:40 +02:00
Alexey Milovidov
097221a3af
Merge pull request #40726 from amosbird/projection-fix-1
Disable projection when grouping set is used.
2022-09-04 04:23:30 +03:00
Alexey Milovidov
22f7bfdcb5
Update gtest_sensitive_data_masker.cpp 2022-09-04 03:42:58 +03:00
Alexey Milovidov
c6f7ddc5e6
Merge branch 'master' into sensitive_data_masker_unittest_issue 2022-09-04 03:42:24 +03:00
Azat Khuzhin
9479e2143f Do not try to load empty debug files
This will avoid CANNOT_PARSE_ELF error for builds that has empty debug
file in clickhouse-common-static-dbg package, i.e. debug build.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-09-02 23:23:05 +02:00
Azat Khuzhin
597197c01d Improve error messages in Elf loader
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-09-02 23:22:25 +02:00
Azat Khuzhin
45afaa6fb8 Fix loading external symbols
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-09-02 23:22:25 +02:00
Igor Nikonov
5d7fa55f36
Merge branch 'master' into sort_mode_rename 2022-09-02 23:19:04 +02:00
Yakov Olkhovskiy
fdcced8962
Merge pull request #40850 from canhld94/ch_canh_fix_set
Fix tryGetPreparedSet crash when same set expression built from different column(s)
2022-09-02 14:40:35 -04:00
kssenii
2dcf3fef94 Fix tests 2022-09-02 19:27:52 +02:00
Alexander Tokmakov
2044470895 review fixes 2022-09-02 19:18:44 +02:00
Suzy Wang
83b029e716 re arrange sensitive data masker unit test scenario order 2022-09-02 10:11:57 -07:00
Sergei Trifonov
7a2d750f7f fix typo 2022-09-02 18:59:16 +02:00
Kseniia Sumarokova
1e81e0ef67
Update WriteBufferFromS3.cpp 2022-09-02 18:54:34 +02:00
Kseniia Sumarokova
7dea71c83f
Merge pull request #40884 from TKaxe/fix_removeUnneededColumn
fix bug when remove unneeded columns in subquery
2022-09-02 18:51:18 +02:00
Kseniia Sumarokova
1370bf0de7
Merge pull request #40820 from kssenii/cache-assert-directory-ownership
Create status file for cache directory
2022-09-02 18:42:11 +02:00
kssenii
239847ad16 Fix races 2022-09-02 18:27:07 +02:00
Anton Popov
dd776eb3d5 fix enumerateStreams 2022-09-02 16:26:38 +00:00
Sergei Trifonov
a6a95e38ca fix style 2022-09-02 18:20:47 +02:00
Anton Popov
464818c142 try to fix filling of missed Nested columns with multiple levels 2022-09-02 15:05:58 +00:00
Sergei Trifonov
067e712fdf
Merge branch 'master' into s3-detailed-metrics 2022-09-02 16:59:52 +02:00
Sergei Trifonov
3daf1f5c77 fix build 2022-09-02 16:57:51 +02:00
Ilya Golshtein
74561b40ae stylecheck renewed 2022-09-02 17:42:18 +03:00
Lloyd-Pottiger
5db220c7fb Merge branch 'master' of github.com:ClickHouse/ClickHouse into feat/support-read-only-for-embeddedrocksdb 2022-09-02 22:40:28 +08:00
Sergei Trifonov
005b2588d8
Merge branch 'master' into readonly-settings-allow 2022-09-02 16:37:43 +02:00
Kruglov Pavel
77071381e4
fix build 2022-09-02 16:37:33 +02:00
Sergei Trifonov
014d109175 fix build, fix docs, fix comments, logical fixes, test are still to be fixed and new test are to be added 2022-09-02 16:20:09 +02:00
kssenii
c9b512e33e Fix 2022-09-02 16:15:54 +02:00
kssenii
0db38fcbc9 Fix 2022-09-02 15:32:46 +02:00
Anton Popov
9dda9658a8 Merge remote-tracking branch 'upstream/master' into HEAD 2022-09-02 12:48:27 +00:00
Vladimir C
963c0111bf
Merge pull request #39418 from vdimir/join_and_sets
Filter joined streams for `full_sorting_join` by each other before sorting
2022-09-02 13:57:06 +02:00
alesapin
3f02995161 Better exceptions handling 2022-09-02 13:54:41 +02:00
Antonio Andelic
b816d46520
Merge branch 'master' into fix-keeper-system-path-check 2022-09-02 13:42:16 +02:00
alesapin
521e2cc22e Merge branch 'master' into stress_s3 2022-09-02 12:57:29 +02:00
Roman Vasin
e1833d3cd6 Merge branch 'master' into ADQM-528-B 2022-09-02 10:40:44 +00:00
alesapin
45fe9c800a
Merge pull request #40898 from georgthegreat/patch-2
Remove remaining usage of // Y_IGNORE magic comment
2022-09-02 12:24:57 +02:00
Antonio Andelic
9ca20b97c2
Merge branch 'master' into keeper-storage 2022-09-02 12:13:07 +02:00
Alexander Tokmakov
3582a51a72
Merge pull request #40920 from ClickHouse/fix-typos
Fix typos found by new `codespell`
2022-09-02 13:11:16 +03:00
Lloyd-Pottiger
5a6b2106b5 Merge branch 'master' of github.com:ClickHouse/ClickHouse into feat/support-read-only-for-embeddedrocksdb 2022-09-02 18:10:00 +08:00
Alexander Tokmakov
5b6a8677ef
Merge pull request #40890 from arthurpassos/patch-1
CaresPTRResolver small safety improvement
2022-09-02 12:29:23 +03:00
Antonio Andelic
e64436fef3 Fix typos with new codespell 2022-09-02 08:54:48 +00:00
Antonio Andelic
ad2196155c Add test for system node modification 2022-09-02 08:14:06 +00:00
Antonio Andelic
b7eebfc626 Correctly check if the node is using system path 2022-09-02 07:47:12 +00:00
Antonio Andelic
f5fc3db0dd Small fix 2022-09-02 07:42:22 +00:00
Antonio Andelic
1a48beec30 Use server UUID 2022-09-02 07:40:39 +00:00
Antonio Andelic
dbf67f26d8 Add prefix path 2022-09-02 07:24:26 +00:00
Robert Schulze
319d8b00a7
Merge pull request #39010 from FrankChen021/tracing_context_propagation
Improve the opentelemetry tracing context propagation across threads
2022-09-02 07:56:43 +02:00
Robert Schulze
c7c00f9002
Merge pull request #40739 from ClickHouse/clang-tidy-for-headers
Enable clang-tidy for headers
2022-09-02 07:54:50 +02:00
Duc Canh Le
65b64010a0 move out-of-bound check into set::areTypesEqual 2022-09-02 11:56:13 +08:00
Duc Canh Le
763328ef53 Merge branch 'master' into ch_canh_fix_set 2022-09-02 11:45:13 +08:00
Lloyd-Pottiger
59dccd6e49 fix test
Signed-off-by: Lloyd-Pottiger <yan1579196623@gamil.com>
2022-09-02 11:14:49 +08:00
Sergei Trifonov
7fec55eea4 work in progress 2022-09-02 04:12:05 +02:00
Sergei Trifonov
29e922f05c support all profile events for disk s3 2022-09-02 02:22:52 +02:00
Kruglov Pavel
5a9d2460dd
Merge pull request #40851 from Avogar/fix-json-object-inference
Fix nested JSON Objects schema inference
2022-09-01 21:07:21 +02:00
Kruglov Pavel
7a4a65bc36
Make better exception message in schema inference 2022-09-01 20:36:08 +02:00
Kruglov Pavel
f53aa86a20
Merge pull request #40485 from arthurpassos/fix-parquet-chunked-array-deserialization
Add support for extended (chunked) arrays for Parquet format
2022-09-01 19:40:40 +02:00
Sergei Trifonov
66b5cf566c fix bugs 2022-09-01 19:02:04 +02:00
Sergei Trifonov
ac9dc53c73 Merge branch 'master' into s3-detailed-metrics 2022-09-01 18:31:02 +02:00
Sergei Trifonov
bcb6475c4a add separate s3 profile events for disk s3 2022-09-01 18:30:55 +02:00
Dmitry Novik
ddadb362cf
Merge pull request #39762 from quickhouse/betterorderbyoptimization
Fixed `Unknown identifier (aggregate-function)` exception which appears when a user tries to calculate WINDOW ORDER BY/PARTITION BY expressions over aggregate functions
2022-09-01 18:08:06 +02:00
Dmitry Novik
2ca619d40f
Merge pull request #40320 from azat/memory-tracker-fix-peak-race
Fix rare race in updating peak of memory tracker
2022-09-01 18:07:33 +02:00
Frank Chen
9d63cbe811 Merge 'origin/master' into tracing_context_propagation to resolve conflicts 2022-09-01 23:18:59 +08:00
Frank Chen
1da35a486c Disable query_span for internal queries 2022-09-01 23:16:05 +08:00
Yuriy Chernyshov
304dc30f0f
Remove remaining usage of // Y_IGNORE magic comment 2022-09-01 18:15:56 +03:00
alesapin
dbe3b777ec Fix build 2022-09-01 17:07:56 +02:00
kssenii
ec55c90f36 Fix 2022-09-01 17:04:34 +02:00
alesapin
89930c315b Merge branch 'master' into stress_s3 2022-09-01 17:03:55 +02:00
kssenii
4fa291cf59 Fix hdfs read buffer too 2022-09-01 16:46:46 +02:00
Robert Schulze
1bbbae8da7
Merge pull request #40785 from ClickHouse/remove-unnecessary-context-access-method
Minor: remove unnecessary ContextAccess::make() method
2022-09-01 16:41:06 +02:00
Antonio Andelic
9231084c57 Style fix 2022-09-01 14:40:50 +00:00
Antonio Andelic
a0c1ce5eb7 Merge branch 'master' into embeddedrocksdb-delete-update-support 2022-09-01 14:40:24 +00:00
kssenii
3134bdeb13 Fix 2022-09-01 16:35:28 +02:00
Alexander Tokmakov
04d431793b
Update src/Common/ZooKeeper/ZooKeeperImpl.cpp
Co-authored-by: Antonio Andelic <antonio2368@users.noreply.github.com>
2022-09-01 17:12:22 +03:00
Alexander Tokmakov
36454a340d
Update src/Common/ZooKeeper/ZooKeeperArgs.cpp
Co-authored-by: Antonio Andelic <antonio2368@users.noreply.github.com>
2022-09-01 17:12:16 +03:00
Vladimir C
12e6fc4182
Merge branch 'master' into join_and_sets 2022-09-01 14:56:14 +02:00
Vladimir C
f2cf7d7762
Merge pull request #40334 from ClickHouse/vdimir/analyze-stuck-limit
Limit number of analyze for one query, att. 2
2022-09-01 14:40:20 +02:00
Kseniia Sumarokova
c6c67a248d
Merge pull request #40792 from canhld94/ch_canh_intersect_distinct
Implement intersect + except distinct
2022-09-01 14:35:26 +02:00
Antonio Andelic
62ff61404f Improve remove recursive 2022-09-01 12:16:13 +00:00
Arthur Passos
fb42afbbac
CaresPTRResolver small safety improvement
Previous to #40769, only `hostent::h_aliases` was being accessed. After that PR got merged, `hostent::h_name` started being accessed as well. This PR moves the first `hostent::h_aliases != nullptr` check that could prevent `hostent::h_name` from being accessed. During debugging, I observed that even when there are not aliases, `hostent::h_aliases` is not null. That's why it hasn't caused any problems, but proposing this change to be on the safe side.
2022-09-01 08:59:14 -03:00
Fangyuan Deng
bc7d661668
Merge branch 'master' into UniqSketch 2022-09-01 19:31:53 +08:00
pzhdfy
acec516271 add docs 2022-09-01 19:31:01 +08:00
Nikita Mikhaylov
c7b0b87574
Better exception handling in DiskObjectStorageTransaction (#40813)
Co-authored-by: alesapin <alesapin@clickhouse.com>
2022-09-01 13:29:59 +02:00
alesapin
f2bcd63618
Merge pull request #40844 from ClickHouse/fix_incorrect_remove_in_zero_copy
Fix incorrect directory remove in zero copy replication
2022-09-01 13:21:58 +02:00
alesapin
1ae7e82126
Merge pull request #40819 from vitlibar/fix-locking-when-writing-backup
Fix locking while writing backup in multiple threads
2022-09-01 13:20:21 +02:00
Vitaly Baranov
6dcca686cb
Merge pull request #40827 from vitlibar/fix-incremental-backups-for-log-family
Fix incremental backups for Log family.
2022-09-01 13:13:32 +02:00
kssenii
82879543d3 Merge remote-tracking branch 'upstream/master' into improve-marks-cache-loading 2022-09-01 13:13:01 +02:00
kssenii
9ae95f8c04 Fix unit test 2022-09-01 13:11:47 +02:00
kssenii
ca4363e2e3 Merge master 2022-09-01 13:09:00 +02:00
Anton Popov
f7bdf07adc
Merge pull request #38715 from CurtizJ/fix-read-in-order-fixed-prefix
Better support of `optimize_read_in_order` in case of fixed prefix of sorting key
2022-09-01 12:59:18 +02:00
Anton Popov
cc49198204
Merge pull request #40754 from CurtizJ/fix-fuzzer-with-object
Avoid logical errors in some common operations with `ColumnObject`
2022-09-01 12:57:32 +02:00
Antonio Andelic
6442824da8 Fix KeeperMap with Replicated database 2022-09-01 10:47:05 +00:00
kssenii
0d1f7afb17 Merge remote-tracking branch 'upstream/master' into fix-removing-directories 2022-09-01 12:28:51 +02:00
Kseniia Sumarokova
849262bd99
Merge pull request #40858 from kssenii/move-cache-files
Move cache files from Common
2022-09-01 12:28:00 +02:00
Sema Checherinda
7b59fdc042
Merge pull request #40779 from CheSema/detached-parts-metric
Metric for the number of detached parts
2022-09-01 12:24:42 +02:00
Duc Canh Le
018f4118bb
Fix view with merge table function (#40734) 2022-09-01 12:20:00 +02:00
luocongkai
56e4179cad fix bug when remove unneeded columns in subquery 2022-09-01 17:10:32 +08:00
Antonio Andelic
7164e59b54 Merge branch 'master' into keeper-linearizable-reads 2022-09-01 08:52:31 +00:00
Antonio Andelic
fa4c7259f9 Fix typos 2022-09-01 08:46:28 +00:00
Antonio Andelic
91aff95298 Merge branch 'master' into keeper-linearizable-reads 2022-09-01 08:43:50 +00:00
Robert Schulze
b3fc6eafe7
Merge pull request #40750 from ClickHouse/last-command-shortcut
Make last command available in clickhouse-client interactive mode
2022-09-01 10:27:31 +02:00
Robert Schulze
de64c6b103
Merge branch 'master' into clang-tidy-for-headers 2022-09-01 10:24:56 +02:00
Robert Schulze
560b6082ee
Merge branch 'master' into remove-unnecessary-context-access-method 2022-09-01 10:10:31 +02:00
Antonio Andelic
c7d1dd942c Address PR comments 2022-09-01 07:56:06 +00:00
Robert Schulze
56eece40ec
Merge pull request #40736 from LevyCory/add-offset-to-formatDateTime
Add timezone offset support  to `formatDateTime`
2022-09-01 09:50:17 +02:00
Antonio Andelic
cecdcb5059
Merge pull request #40627 from ClickHouse/fix-install-snapshot
Keeper fix for install snapshot and preprocessing performance improvements
2022-09-01 09:13:01 +02:00
Robert Coelho
19097c433d
fix compile error 2022-09-01 01:34:41 -04:00
Frank Chen
d9a516288c Resolve comments 2022-09-01 11:56:10 +08:00
Robert Coelho
e0597700eb
Fix uncaught DNS_ERROR on failed connection to replicas
DNS_ERROR would cause the replica to not be marked as unusable, resulting in the replica being repeatedly reattempted on subsequent queries and for connection failover to break.
(This is common in Kubernetes setups where a replica has failed and it's DNS record is returning NXDOMAIN)

On SELECT, would additionally result in an intermittent query error if the failed replica is chosen:
"Code: 198. DB::Exception: Received from localhost:9000. DB::Exception: Not found address of host: chi-clickhouse-main-2-0: While executing Remote. (DNS_ERROR)"
2022-08-31 20:34:14 -04:00
Nikolay Degterinsky
e98ceb2575
Merge pull request #40251 from ClibMouse/Structured-logging-custom-keys
Feature Improvement: Custom Key Names for Structured Logging Support
2022-09-01 00:36:23 +02:00
kssenii
10a7e73d52 Fix unit test 2022-08-31 21:07:39 +02:00
Robert Schulze
912663b719
Revert "Move CatBoost evaluation into clickhouse-library-bridge" 2022-08-31 20:54:43 +02:00
alesapin
251bdab9a0 Better grep 2022-08-31 20:08:47 +02:00
kssenii
a78571de11 Fix 2022-08-31 18:47:47 +02:00
Kruglov Pavel
86516d3bb4
Merge pull request #40740 from amosbird/row-policy-index-fix-1
Use index when row_policy_filter is always false
2022-08-31 18:46:14 +02:00
Kruglov Pavel
b7ea529307
Merge pull request #40746 from Avogar/fix-csv-schema-inference
Fix possible error Attempt to read after eof in CSV schema inference
2022-08-31 18:29:01 +02:00
Kseniia Sumarokova
6e61a4f49f
Update unit test 2022-08-31 18:07:40 +02:00
kssenii
0f747e7987 Move cache files 2022-08-31 17:50:55 +02:00
Antonio Andelic
f043790e6d Add support for update 2022-08-31 14:33:53 +00:00
Robert Schulze
ca01286028
Merge pull request #39629 from ClickHouse/catboost-bridge
Move CatBoost evaluation into clickhouse-library-bridge
2022-08-31 16:16:11 +02:00
avogar
acf87c1d10 Fix nested JSON Objects schema inference 2022-08-31 14:10:29 +00:00
Anton Popov
5a3e24c4e4
Merge pull request #40483 from canhld94/ch_canh_fix_json
Fix columnObject crash with array of variadic dimension elems
2022-08-31 16:07:58 +02:00
Duc Canh Le
55c20ce45b fix tryGetPreparedSet crash when same set expression built from different columns 2022-08-31 21:43:08 +08:00
kssenii
3a183236a2 Fix 2022-08-31 15:39:53 +02:00
alesapin
10b456ce64
Merge branch 'master' into fix-locking-when-writing-backup 2022-08-31 15:12:23 +02:00
Antonio Andelic
0e6b3b870a Add support for delete in RocksDB 2022-08-31 13:08:27 +00:00
alesapin
c427491bcb Better 2022-08-31 15:05:45 +02:00
alesapin
a4f71ba6b8 Fix one more bug 2022-08-31 14:53:33 +02:00
alesapin
2d976753e1 Fix incorrect directory remove in zero copy replication 2022-08-31 13:50:59 +02:00
Vitaly Baranov
007ae0e6cc Fix incremental backups for Log family. 2022-08-31 12:57:28 +02:00
Robert Schulze
cedf75ed5e
Enable clang-tidy for headers
clang-tidy now also checks code in header files. Because the analyzer
finds tons of issues, activate the check only for directory "base/" (see
file ".clang-tidy"). All other directories, in particular "src/" are
left to future work.

While many findings were fixed, some were not (and suppressed instead).
Reasons for this include: a) the file is 1:1 copypaste of a 3rd-party
lib (e.g. pcg_extras.h) and fixing stuff would make upgrades/fixes more
difficult b) a fix would have broken lots of using code
2022-08-31 10:48:15 +00:00
Antonio Andelic
7d5e13c6ba Use async exist for write 2022-08-31 10:40:32 +00:00
Antonio Andelic
9dd1a9859d Merge branch 'master' into keeper-storage 2022-08-31 10:12:11 +00:00
vdimir
6c15db9b11 Setting max_analyze_depth forbid only second analyze 2022-08-31 11:57:41 +02:00
vdimir
473c9106a5 Revert "Create new query context in StorageRabbitMQ/Nat"
This reverts commit 2d6ac7344a25134a625e879da63b9a4aa20d9a69.
2022-08-31 11:57:41 +02:00
vdimir
63f7301ee0 Create new query context in StorageRabbitMQ/Nat 2022-08-31 11:57:41 +02:00
vdimir
60454bd722 Fix error codes in InterpreterSelectQuery.cpp 2022-08-31 11:57:41 +02:00
vdimir
c829a1914d Disable max_analyze_depth for StorageRabbitMQ/NATS 2022-08-31 11:57:41 +02:00
vdimir
f38f39ed6f Use max_analyze_depth 2022-08-31 11:57:41 +02:00
vdimir
928adb2b38 [WIP] Limit number of analyze for one query 2022-08-31 11:57:41 +02:00
Kseniia Sumarokova
164ebbe009
Merge branch 'master' into cache-assert-directory-ownership 2022-08-31 11:56:59 +02:00
Kseniia Sumarokova
9abcfce529
Merge pull request #40759 from kssenii/fix-write-through-cache-logical-error
Fix logical error from write-though cache from stress test
2022-08-31 11:55:18 +02:00
Antonio Andelic
1af9a81297 Sync after reconnect 2022-08-31 08:29:40 +00:00
Antonio Andelic
1ff14aed02 Fix dropping table 2022-08-31 08:23:44 +00:00
Antonio Andelic
5ef4c52290 Add support for keys limit 2022-08-31 08:14:28 +00:00
Robert Schulze
5ff0ecb867
Merge branch 'master' into remove-unnecessary-context-access-method 2022-08-31 10:14:27 +02:00
Antonio Andelic
97fd3d9123
Merge branch 'master' into fix-install-snapshot 2022-08-31 08:42:00 +02:00
Duc Canh Le
aebd1cb7de
Merge branch 'master' into ch_canh_intersect_distinct 2022-08-31 12:08:20 +08:00
Fangyuan Deng
5c2f35c302
Merge branch 'master' into UniqSketch 2022-08-31 10:23:46 +08:00
Mallik Hassan
87a28c25f5 Update src/Loggers/Loggers.cpp
Co-authored-by: Nikolay Degterinsky <43110995+evillique@users.noreply.github.com>
2022-08-30 23:20:19 -03:00
root
f02f7ce99c addressed minor change requests 2022-08-30 23:20:19 -03:00