https://s3.amazonaws.com/clickhouse-test-reports/36005/5af0537f2cc5da4ee27d659b6c9896810757e22c/stateless_tests__thread__actions__[2/3].html

```
==================
WARNING: ThreadSanitizer: data race (pid=400)
  Write of size 8 at 0x7efd498b25d8 by thread T335:
    #0 DB::StorageFileLog::streamToViews()::$_2::operator()(DB::Progress const&) const build_docker/../src/Storages/FileLog/StorageFileLog.cpp:727:85 (clickhouse+0x1a9a92e2)
    #1 decltype(static_cast<DB::StorageFileLog::streamToViews()::$_2&>(fp)(static_cast<DB::Progress const&>(fp0))) std::__1::__invoke<DB::StorageFileLog::streamToViews()::$_2&, DB::Progress const&>(DB::StorageFileLog::streamToViews()::$_2&, DB::Progress const&) build_docker/../contrib/libcxx/include/type_traits:3640:23 (clickhouse+0x1a9a92e2)
    #2 void std::__1::__invoke_void_return_wrapper<void, true>::__call<DB::StorageFileLog::streamToViews()::$_2&, DB::Progress const&>(DB::StorageFileLog::streamToViews()::$_2&, DB::Progress const&) build_docker/../contrib/libcxx/include/__functional/invoke.h:61:9 (clickhouse+0x1a9a92e2)
    #3 std::__1::__function::__default_alloc_func<DB::StorageFileLog::streamToViews()::$_2, void (DB::Progress const&)>::operator()(DB::Progress const&) build_docker/../contrib/libcxx/include/__functional/function.h:230:12 (clickhouse+0x1a9a92e2)
    #4 void std::__1::__function::__policy_invoker<void (DB::Progress const&)>::__call_impl<std::__1::__function::__default_alloc_func<DB::StorageFileLog::streamToViews()::$_2, void (DB::Progress const&)> >(std::__1::__function::__policy_storage const*, DB::Progress const&) build_docker/../contrib/libcxx/include/__functional/function.h:711:16 (clickhouse+0x1a9a92e2)
    #5 std::__1::__function::__policy_func<void (DB::Progress const&)>::operator()(DB::Progress const&) const build_docker/../contrib/libcxx/include/__functional/function.h:843:16 (clickhouse+0x1b254eb9)
    #6 std::__1::function<void (DB::Progress const&)>::operator()(DB::Progress const&) const build_docker/../contrib/libcxx/include/__functional/function.h:1184:12 (clickhouse+0x1b254eb9)
    #7 DB::SourceWithProgress::progress(DB::Progress const&) build_docker/../src/Processors/Sources/SourceWithProgress.cpp:93:9 (clickhouse+0x1b254eb9)
    #8 DB::SourceWithProgress::work() build_docker/../src/Processors/Sources/SourceWithProgress.cpp:70:13 (clickhouse+0x1b254cc5)
    #9 DB::executeJob(DB::IProcessor*) build_docker/../src/Processors/Executors/ExecutionThreadContext.cpp:45:20 (clickhouse+0x1af98dae)
    #10 DB::ExecutionThreadContext::executeTask() build_docker/../src/Processors/Executors/ExecutionThreadContext.cpp:63:9 (clickhouse+0x1af98dae)
    #11 DB::PipelineExecutor::executeStepImpl(unsigned long, std::__1::atomic<bool>*) build_docker/../src/Processors/Executors/PipelineExecutor.cpp:213:26 (clickhouse+0x1af8ade0)
    #12 DB::PipelineExecutor::executeSingleThread(unsigned long) build_docker/../src/Processors/Executors/PipelineExecutor.cpp:178:5 (clickhouse+0x1af8bfd5)
    #13 DB::PipelineExecutor::executeImpl(unsigned long)::$_1::operator()() const build_docker/../src/Processors/Executors/PipelineExecutor.cpp:306:21 (clickhouse+0x1af8bfd5)
    #14 decltype(static_cast<DB::PipelineExecutor::executeImpl(unsigned long)::$_1&>(fp)()) std::__1::__invoke_constexpr<DB::PipelineExecutor::executeImpl(unsigned long)::$_1&>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&) build_docker/../contrib/libcxx/include/type_traits:3648:23 (clickhouse+0x1af8bfd5)
    #15 decltype(auto) std::__1::__apply_tuple_impl<DB::PipelineExecutor::executeImpl(unsigned long)::$_1&, std::__1::tuple<>&>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&, std::__1::tuple<>&, std::__1::__tuple_indices<>) build_docker/../contrib/libcxx/include/tuple:1595:1 (clickhouse+0x1af8bfd5)
    #16 decltype(auto) std::__1::apply<DB::PipelineExecutor::executeImpl(unsigned long)::$_1&, std::__1::tuple<>&>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&, std::__1::tuple<>&) build_docker/../contrib/libcxx/include/tuple:1604:1 (clickhouse+0x1af8bfd5)
    #17 ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&)::'lambda'()::operator()() build_docker/../src/Common/ThreadPool.h:188:13 (clickhouse+0x1af8bfd5)
    #18 decltype(static_cast<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(fp)()) std::__1::__invoke<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&)::'lambda'()&>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&) build_docker/../contrib/libcxx/include/type_traits:3640:23 (clickhouse+0x1af8bfd5)
    #19 void std::__1::__invoke_void_return_wrapper<void, true>::__call<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&)::'lambda'()&>(ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&)::'lambda'()&) build_docker/../contrib/libcxx/include/__functional/invoke.h:61:9 (clickhouse+0x1af8bfd5)
    #20 std::__1::__function::__default_alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&)::'lambda'(), void ()>::operator()() build_docker/../contrib/libcxx/include/__functional/function.h:230:12 (clickhouse+0x1af8bfd5)
    #21 void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&)::'lambda'(), void ()> >(std::__1::__function::__policy_storage const*) build_docker/../contrib/libcxx/include/__functional/function.h:711:16 (clickhouse+0x1af8bfd5)
    #22 std::__1::__function::__policy_func<void ()>::operator()() const build_docker/../contrib/libcxx/include/__functional/function.h:843:16 (clickhouse+0xb29580d)
    #23 std::__1::function<void ()>::operator()() const build_docker/../contrib/libcxx/include/__functional/function.h:1184:12 (clickhouse+0xb29580d)
    #24 ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) build_docker/../src/Common/ThreadPool.cpp:277:17 (clickhouse+0xb29580d)
    #25 void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()::operator()() const build_docker/../src/Common/ThreadPool.cpp:142:73 (clickhouse+0xb299050)
    #26 decltype(static_cast<void>(fp)()) std::__1::__invoke<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(void&&) build_docker/../contrib/libcxx/include/type_traits:3640:23 (clickhouse+0xb299050)
    #27 void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(std::__1::tuple<void, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>&, std::__1::__tuple_indices<>) build_docker/../contrib/libcxx/include/thread:282:5 (clickhouse+0xb299050)
    #28 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()> >(void*) build_docker/../contrib/libcxx/include/thread:293:5 (clickhouse+0xb299050)

  Previous write of size 8 at 0x7efd498b25d8 by thread T273:
    #0 DB::StorageFileLog::streamToViews()::$_2::operator()(DB::Progress const&) const build_docker/../src/Storages/FileLog/StorageFileLog.cpp:727:85 (clickhouse+0x1a9a92e2)
    #1 decltype(static_cast<DB::StorageFileLog::streamToViews()::$_2&>(fp)(static_cast<DB::Progress const&>(fp0))) std::__1::__invoke<DB::StorageFileLog::streamToViews()::$_2&, DB::Progress const&>(DB::StorageFileLog::streamToViews()::$_2&, DB::Progress const&) build_docker/../contrib/libcxx/include/type_traits:3640:23 (clickhouse+0x1a9a92e2)
    #2 void std::__1::__invoke_void_return_wrapper<void, true>::__call<DB::StorageFileLog::streamToViews()::$_2&, DB::Progress const&>(DB::StorageFileLog::streamToViews()::$_2&, DB::Progress const&) build_docker/../contrib/libcxx/include/__functional/invoke.h:61:9 (clickhouse+0x1a9a92e2)
    #3 std::__1::__function::__default_alloc_func<DB::StorageFileLog::streamToViews()::$_2, void (DB::Progress const&)>::operator()(DB::Progress const&) build_docker/../contrib/libcxx/include/__functional/function.h:230:12 (clickhouse+0x1a9a92e2)
    #4 void std::__1::__function::__policy_invoker<void (DB::Progress const&)>::__call_impl<std::__1::__function::__default_alloc_func<DB::StorageFileLog::streamToViews()::$_2, void (DB::Progress const&)> >(std::__1::__function::__policy_storage const*, DB::Progress const&) build_docker/../contrib/libcxx/include/__functional/function.h:711:16 (clickhouse+0x1a9a92e2)
    #5 std::__1::__function::__policy_func<void (DB::Progress const&)>::operator()(DB::Progress const&) const build_docker/../contrib/libcxx/include/__functional/function.h:843:16 (clickhouse+0x1b254eb9)
    #6 std::__1::function<void (DB::Progress const&)>::operator()(DB::Progress const&) const build_docker/../contrib/libcxx/include/__functional/function.h:1184:12 (clickhouse+0x1b254eb9)
    #7 DB::SourceWithProgress::progress(DB::Progress const&) build_docker/../src/Processors/Sources/SourceWithProgress.cpp:93:9 (clickhouse+0x1b254eb9)
    #8 DB::SourceWithProgress::work() build_docker/../src/Processors/Sources/SourceWithProgress.cpp:70:13 (clickhouse+0x1b254cc5)
    #9 DB::executeJob(DB::IProcessor*) build_docker/../src/Processors/Executors/ExecutionThreadContext.cpp:45:20 (clickhouse+0x1af98dae)
    #10 DB::ExecutionThreadContext::executeTask() build_docker/../src/Processors/Executors/ExecutionThreadContext.cpp:63:9 (clickhouse+0x1af98dae)
    #11 DB::PipelineExecutor::executeStepImpl(unsigned long, std::__1::atomic<bool>*) build_docker/../src/Processors/Executors/PipelineExecutor.cpp:213:26 (clickhouse+0x1af8ade0)
    #12 DB::PipelineExecutor::executeSingleThread(unsigned long) build_docker/../src/Processors/Executors/PipelineExecutor.cpp:178:5 (clickhouse+0x1af8bfd5)
    #13 DB::PipelineExecutor::executeImpl(unsigned long)::$_1::operator()() const build_docker/../src/Processors/Executors/PipelineExecutor.cpp:306:21 (clickhouse+0x1af8bfd5)
    #14 decltype(static_cast<DB::PipelineExecutor::executeImpl(unsigned long)::$_1&>(fp)()) std::__1::__invoke_constexpr<DB::PipelineExecutor::executeImpl(unsigned long)::$_1&>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&) build_docker/../contrib/libcxx/include/type_traits:3648:23 (clickhouse+0x1af8bfd5)
    #15 decltype(auto) std::__1::__apply_tuple_impl<DB::PipelineExecutor::executeImpl(unsigned long)::$_1&, std::__1::tuple<>&>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&, std::__1::tuple<>&, std::__1::__tuple_indices<>) build_docker/../contrib/libcxx/include/tuple:1595:1 (clickhouse+0x1af8bfd5)
    #16 decltype(auto) std::__1::apply<DB::PipelineExecutor::executeImpl(unsigned long)::$_1&, std::__1::tuple<>&>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&, std::__1::tuple<>&) build_docker/../contrib/libcxx/include/tuple:1604:1 (clickhouse+0x1af8bfd5)
    #17 ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&)::'lambda'()::operator()() build_docker/../src/Common/ThreadPool.h:188:13 (clickhouse+0x1af8bfd5)
    #18 decltype(static_cast<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(fp)()) std::__1::__invoke<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&)::'lambda'()&>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&) build_docker/../contrib/libcxx/include/type_traits:3640:23 (clickhouse+0x1af8bfd5)
    #19 void std::__1::__invoke_void_return_wrapper<void, true>::__call<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&)::'lambda'()&>(ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&)::'lambda'()&) build_docker/../contrib/libcxx/include/__functional/invoke.h:61:9 (clickhouse+0x1af8bfd5)
    #20 std::__1::__function::__default_alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&)::'lambda'(), void ()>::operator()() build_docker/../contrib/libcxx/include/__functional/function.h:230:12 (clickhouse+0x1af8bfd5)
    #21 void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&)::'lambda'(), void ()> >(std::__1::__function::__policy_storage const*) build_docker/../contrib/libcxx/include/__functional/function.h:711:16 (clickhouse+0x1af8bfd5)
    #22 std::__1::__function::__policy_func<void ()>::operator()() const build_docker/../contrib/libcxx/include/__functional/function.h:843:16 (clickhouse+0xb29580d)
    #23 std::__1::function<void ()>::operator()() const build_docker/../contrib/libcxx/include/__functional/function.h:1184:12 (clickhouse+0xb29580d)
    #24 ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) build_docker/../src/Common/ThreadPool.cpp:277:17 (clickhouse+0xb29580d)
    #25 void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()::operator()() const build_docker/../src/Common/ThreadPool.cpp:142:73 (clickhouse+0xb299050)
    #26 decltype(static_cast<void>(fp)()) std::__1::__invoke<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(void&&) build_docker/../contrib/libcxx/include/type_traits:3640:23 (clickhouse+0xb299050)
    #27 void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(std::__1::tuple<void, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>&, std::__1::__tuple_indices<>) build_docker/../contrib/libcxx/include/thread:282:5 (clickhouse+0xb299050)
    #28 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()> >(void*) build_docker/../contrib/libcxx/include/thread:293:5 (clickhouse+0xb299050)

  Location is stack of thread T155.

  Thread T335 'QueryPipelineEx' (tid=2023, running) created by thread T305 at:
    #0 pthread_create <null> (clickhouse+0xb14d41d)
    #1 std::__1::__libcpp_thread_create(unsigned long*, void* (*)(void*), void*) build_docker/../contrib/libcxx/include/__threading_support:375:10 (clickhouse+0xb298b00)
    #2 std::__1::thread::thread<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'(), void>(void&&) build_docker/../contrib/libcxx/include/thread:309:16 (clickhouse+0xb298b00)
    #3 void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>) build_docker/../src/Common/ThreadPool.cpp:142:35 (clickhouse+0xb293e34)
    #4 ThreadPoolImpl<std::__1::thread>::scheduleOrThrow(std::__1::function<void ()>, int, unsigned long) build_docker/../src/Common/ThreadPool.cpp:174:5 (clickhouse+0xb294767)
    #5 ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&) build_docker/../src/Common/ThreadPool.h:169:38 (clickhouse+0x1af8bc47)
    #6 ThreadFromGlobalPool* std::__1::construct_at<ThreadFromGlobalPool, DB::PipelineExecutor::executeImpl(unsigned long)::$_1, ThreadFromGlobalPool*>(ThreadFromGlobalPool*, DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&) build_docker/../contrib/libcxx/include/__memory/construct_at.h:38:50 (clickhouse+0x1af8bc47)
    #7 void std::__1::allocator_traits<std::__1::allocator<ThreadFromGlobalPool> >::construct<ThreadFromGlobalPool, DB::PipelineExecutor::executeImpl(unsigned long)::$_1, void, void>(std::__1::allocator<ThreadFromGlobalPool>&, ThreadFromGlobalPool*, DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&) build_docker/../contrib/libcxx/include/__memory/allocator_traits.h:298:9 (clickhouse+0x1af8bc47)
    #8 void std::__1::vector<ThreadFromGlobalPool, std::__1::allocator<ThreadFromGlobalPool> >::__construct_one_at_end<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&) build_docker/../contrib/libcxx/include/vector:778:5 (clickhouse+0x1af89e04)
    #9 ThreadFromGlobalPool& std::__1::vector<ThreadFromGlobalPool, std::__1::allocator<ThreadFromGlobalPool> >::emplace_back<DB::PipelineExecutor::executeImpl(unsigned long)::$_1>(DB::PipelineExecutor::executeImpl(unsigned long)::$_1&&) build_docker/../contrib/libcxx/include/vector:1577:9 (clickhouse+0x1af89e04)
    #10 DB::PipelineExecutor::executeImpl(unsigned long) build_docker/../src/Processors/Executors/PipelineExecutor.cpp:295:21 (clickhouse+0x1af89e04)
    #11 DB::PipelineExecutor::execute(unsigned long) build_docker/../src/Processors/Executors/PipelineExecutor.cpp:84:9 (clickhouse+0x1af89af8)
    #12 DB::threadFunction(DB::PullingAsyncPipelineExecutor::Data&, std::__1::shared_ptr<DB::ThreadGroupStatus>, unsigned long) build_docker/../src/Processors/Executors/PullingAsyncPipelineExecutor.cpp:78:24 (clickhouse+0x1af9ce43)
    #13 DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0::operator()() const build_docker/../src/Processors/Executors/PullingAsyncPipelineExecutor.cpp:105:13 (clickhouse+0x1af9ce43)
    #14 decltype(static_cast<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&>(fp)()) std::__1::__invoke_constexpr<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&) build_docker/../contrib/libcxx/include/type_traits:3648:23 (clickhouse+0x1af9ce43)
    #15 decltype(auto) std::__1::__apply_tuple_impl<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&, std::__1::tuple<>&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&, std::__1::tuple<>&, std::__1::__tuple_indices<>) build_docker/../contrib/libcxx/include/tuple:1595:1 (clickhouse+0x1af9ce43)
    #16 decltype(auto) std::__1::apply<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&, std::__1::tuple<>&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&, std::__1::tuple<>&) build_docker/../contrib/libcxx/include/tuple:1604:1 (clickhouse+0x1af9ce43)
    #17 ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'()::operator()() build_docker/../src/Common/ThreadPool.h:188:13 (clickhouse+0x1af9ce43)
    #18 decltype(static_cast<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(fp)()) std::__1::__invoke<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'()&>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&) build_docker/../contrib/libcxx/include/type_traits:3640:23 (clickhouse+0x1af9ce43)
    #19 void std::__1::__invoke_void_return_wrapper<void, true>::__call<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'()&>(ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'()&) build_docker/../contrib/libcxx/include/__functional/invoke.h:61:9 (clickhouse+0x1af9ce43)
    #20 std::__1::__function::__default_alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'(), void ()>::operator()() build_docker/../contrib/libcxx/include/__functional/function.h:230:12 (clickhouse+0x1af9ce43)
    #21 void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__default_alloc_func<ThreadFromGlobalPool::ThreadFromGlobalPool<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'(), void ()> >(std::__1::__function::__policy_storage const*) build_docker/../contrib/libcxx/include/__functional/function.h:711:16 (clickhouse+0x1af9ce43)
    #22 std::__1::__function::__policy_func<void ()>::operator()() const build_docker/../contrib/libcxx/include/__functional/function.h:843:16 (clickhouse+0xb29580d)
    #23 std::__1::function<void ()>::operator()() const build_docker/../contrib/libcxx/include/__functional/function.h:1184:12 (clickhouse+0xb29580d)
    #24 ThreadPoolImpl<std::__1::thread>::worker(std::__1::__list_iterator<std::__1::thread, void*>) build_docker/../src/Common/ThreadPool.cpp:277:17 (clickhouse+0xb29580d)
    #25 void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()::operator()() const build_docker/../src/Common/ThreadPool.cpp:142:73 (clickhouse+0xb299050)
    #26 decltype(static_cast<void>(fp)()) std::__1::__invoke<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(void&&) build_docker/../contrib/libcxx/include/type_traits:3640:23 (clickhouse+0xb299050)
    #27 void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(std::__1::tuple<void, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>&, std::__1::__tuple_indices<>) build_docker/../contrib/libcxx/include/thread:282:5 (clickhouse+0xb299050)
    #28 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()> >(void*) build_docker/../contrib/libcxx/include/thread:293:5 (clickhouse+0xb299050)

  Thread T273 'QueryPipelineEx' (tid=706, running) created by thread T259 at:
    #0 pthread_create <null> (clickhouse+0xb14d41d)
    #1 std::__1::__libcpp_thread_create(unsigned long*, void* (*)(void*), void*) build_docker/../contrib/libcxx/include/__threading_support:375:10 (clickhouse+0xb298b00)
    #2 std::__1::thread::thread<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'(), void>(void&&) build_docker/../contrib/libcxx/include/thread:309:16 (clickhouse+0xb298b00)
    #3 void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>) build_docker/../src/Common/ThreadPool.cpp:142:35 (clickhouse+0xb293e34)
    #4 ThreadPoolImpl<std::__1::thread>::scheduleOrThrow(std::__1::function<void ()>, int, unsigned long) build_docker/../src/Common/ThreadPool.cpp:174:5 (clickhouse+0xb29a20f)
    #5 ThreadFromGlobalPool::ThreadFromGlobalPool<void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'()>(void&&) build_docker/../src/Common/ThreadPool.h:169:38 (clickhouse+0xb29a20f)
    #6 void ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>) build_docker/../src/Common/ThreadPool.cpp:142:35 (clickhouse+0xb296406)
    #7 ThreadPoolImpl<ThreadFromGlobalPool>::scheduleOrThrowOnError(std::__1::function<void ()>, int) build_docker/../src/Common/ThreadPool.cpp:162:5 (clickhouse+0xb295fdf)
    #8 DB::ParallelFormattingOutputFormat::scheduleFormatterThreadForUnitWithNumber(unsigned long, unsigned long) build_docker/../src/Processors/Formats/Impl/ParallelFormattingOutputFormat.h:251:14 (clickhouse+0x1b092432)
    #9 DB::ParallelFormattingOutputFormat::addChunk(DB::Chunk, DB::ParallelFormattingOutputFormat::ProcessingUnitType, bool) build_docker/../src/Processors/Formats/Impl/ParallelFormattingOutputFormat.cpp:66:9 (clickhouse+0x1b091055)
    #10 DB::ParallelFormattingOutputFormat::writePrefix() build_docker/../src/Processors/Formats/Impl/ParallelFormattingOutputFormat.h:110:9 (clickhouse+0x1b0936ff)
    #11 DB::IOutputFormat::writePrefixIfNot() build_docker/../src/Processors/Formats/IOutputFormat.h:93:13 (clickhouse+0x1afa796c)
    #12 DB::IOutputFormat::work() build_docker/../src/Processors/Formats/IOutputFormat.cpp:68:5 (clickhouse+0x1afa796c)
    #13 DB::executeJob(DB::IProcessor*) build_docker/../src/Processors/Executors/ExecutionThreadContext.cpp:45:20 (clickhouse+0x1af98dae)
    #14 DB::ExecutionThreadContext::executeTask() build_docker/../src/Processors/Executors/ExecutionThreadContext.cpp:63:9 (clickhouse+0x1af98dae)
    #15 DB::PipelineExecutor::executeStepImpl(unsigned long, std::__1::atomic<bool>*) build_docker/../src/Processors/Executors/PipelineExecutor.cpp:213:26 (clickhouse+0x1af8ade0)
    #16 DB::PipelineExecutor::executeSingleThread(unsigned long) build_docker/../src/Processors/Executors/PipelineExecutor.cpp:178:5 (clickhouse+0x1af8a26b)
    #17 DB::PipelineExecutor::executeImpl(unsigned long) build_docker/../src/Processors/Executors/PipelineExecutor.cpp:324:9 (clickhouse+0x1af8a26b)
    #18 DB::PipelineExecutor::execute(unsigned long) build_docker/../src/Processors/Executors/PipelineExecutor.cpp:84:9 (clickhouse+0x1af89af8)
    #19 DB::CompletedPipelineExecutor::execute() build_docker/../src/Processors/Executors/CompletedPipelineExecutor.cpp:95:18 (clickhouse+0x1af88792)
    #20 DB::executeQuery(DB::ReadBuffer&, DB::WriteBuffer&, bool, std::__1::shared_ptr<DB::Context>, std::__1::function<void (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)>, std::__1::optional<DB::FormatSettings> const&) build_docker/../src/Interpreters/executeQuery.cpp:1132:22 (clickhouse+0x1a157c1b)
    #21 DB::HTTPHandler::processQuery(DB::HTTPServerRequest&, DB::HTMLForm&, DB::HTTPServerResponse&, DB::HTTPHandler::Output&, std::__1::optional<DB::CurrentThread::QueryScope>&) build_docker/../src/Server/HTTPHandler.cpp:821:5 (clickhouse+0x1aec0887)
    #22 DB::HTTPHandler::handleRequest(DB::HTTPServerRequest&, DB::HTTPServerResponse&) build_docker/../src/Server/HTTPHandler.cpp:959:9 (clickhouse+0x1aec49e7)
    #23 DB::HTTPServerConnection::run() build_docker/../src/Server/HTTP/HTTPServerConnection.cpp:65:34 (clickhouse+0x1af31069)
    #24 Poco::Net::TCPServerConnection::start() build_docker/../contrib/poco/Net/src/TCPServerConnection.cpp:43:3 (clickhouse+0x1e5d3d22)
    #25 Poco::Net::TCPServerDispatcher::run() build_docker/../contrib/poco/Net/src/TCPServerDispatcher.cpp:115:20 (clickhouse+0x1e5d4592)
    #26 Poco::PooledThread::run() build_docker/../contrib/poco/Foundation/src/ThreadPool.cpp:199:14 (clickhouse+0x1e82b415)
    #27 Poco::(anonymous namespace)::RunnableHolder::run() build_docker/../contrib/poco/Foundation/src/Thread.cpp:55:11 (clickhouse+0x1e8295af)
    #28 Poco::ThreadImpl::runnableEntry(void*) build_docker/../contrib/poco/Foundation/src/Thread_POSIX.cpp:345:27 (clickhouse+0x1e827c27)

  Thread T155 'BgSchPool' (tid=568, running) created by main thread at:
    #0 pthread_create <null> (clickhouse+0xb14d41d)
    #1 std::__1::__libcpp_thread_create(unsigned long*, void* (*)(void*), void*) build_docker/../contrib/libcxx/include/__threading_support:375:10 (clickhouse+0xb298b00)
    #2 std::__1::thread::thread<void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>)::'lambda0'(), void>(void&&) build_docker/../contrib/libcxx/include/thread:309:16 (clickhouse+0xb298b00)
    #3 void ThreadPoolImpl<std::__1::thread>::scheduleImpl<void>(std::__1::function<void ()>, int, std::__1::optional<unsigned long>) build_docker/../src/Common/ThreadPool.cpp:142:35 (clickhouse+0xb293e34)
    #4 ThreadPoolImpl<std::__1::thread>::scheduleOrThrow(std::__1::function<void ()>, int, unsigned long) build_docker/../src/Common/ThreadPool.cpp:174:5 (clickhouse+0xb294767)
    #5 ThreadFromGlobalPool::ThreadFromGlobalPool<DB::BackgroundSchedulePool::BackgroundSchedulePool(unsigned long, unsigned long, char const*)::$_1>(DB::BackgroundSchedulePool::BackgroundSchedulePool(unsigned long, unsigned long, char const*)::$_1&&) build_docker/../src/Common/ThreadPool.h:169:38 (clickhouse+0x18f93b8b)
    #6 DB::BackgroundSchedulePool::BackgroundSchedulePool(unsigned long, unsigned long, char const*) build_docker/../src/Core/BackgroundSchedulePool.cpp:160:18 (clickhouse+0x18f93b8b)
    #7 std::__1::__unique_if<DB::BackgroundSchedulePool>::__unique_single std::__1::make_unique<DB::BackgroundSchedulePool, DB::SettingFieldNumber<unsigned long> const&, unsigned long const&, char const (&) [10]>(DB::SettingFieldNumber<unsigned long> const&, unsigned long const&, char const (&) [10]) build_docker/../contrib/libcxx/include/__memory/unique_ptr.h:725:32 (clickhouse+0x198891f3)
    #8 DB::Context::getSchedulePool() const build_docker/../src/Interpreters/Context.cpp:1806:33 (clickhouse+0x198891f3)
    #9 DB::DatabaseCatalog::loadDatabases() build_docker/../src/Interpreters/DatabaseCatalog.cpp:149:38 (clickhouse+0x198fb9b7)
    #10 DB::Server::main(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) build_docker/../programs/server/Server.cpp:1439:26 (clickhouse+0xb1d526e)
    #11 Poco::Util::Application::run() build_docker/../contrib/poco/Util/src/Application.cpp:334:8 (clickhouse+0x1e5ebbaa)
    #12 DB::Server::run() build_docker/../programs/server/Server.cpp:456:25 (clickhouse+0xb1c78d4)
    #13 Poco::Util::ServerApplication::run(int, char**) build_docker/../contrib/poco/Util/src/ServerApplication.cpp:611:9 (clickhouse+0x1e60a3e6)
    #14 mainEntryClickHouseServer(int, char**) build_docker/../programs/server/Server.cpp:187:20 (clickhouse+0xb1c53f6)
    #15 main build_docker/../programs/main.cpp:378:12 (clickhouse+0xb1c377a)

SUMMARY: ThreadSanitizer: data race build_docker/../src/Storages/FileLog/StorageFileLog.cpp:727:85 in DB::StorageFileLog::streamToViews()::$_2::operator()(DB::Progress const&) const
==================
```

cc: @ucasfl, @kssenii 
{
    struct stat file_stat;
    if (stat(file_name.c_str(), &file_stat))
    {
        throw Exception(ErrorCodes::CANNOT_STAT, "Can not get stat info of file {}", file_name);
    }
    return file_stat.st_ino;
}
Pipe StorageFileLog::read(
    const Names & column_names,
    const StorageSnapshotPtr & storage_snapshot,
    SelectQueryInfo & ,
    ContextPtr local_context,
    QueryProcessingStage::Enum ,
    size_t ,
    unsigned )
{
    
    if (!local_context->getSettingsRef().stream_like_engine_allow_direct_select)
        throw Exception(ErrorCodes::QUERY_NOT_ALLOWED, "Direct select is not allowed. To enable use setting `stream_like_engine_allow_direct_select`");
    if (mv_attached)
        throw Exception(ErrorCodes::QUERY_NOT_ALLOWED, "Cannot read from StorageFileLog with attached materialized views");
    std::lock_guard<std::mutex> lock(file_infos_mutex);
    if (running_streams)
    {
        throw Exception("Another select query is running on this table, need to wait it finish.", ErrorCodes::CANNOT_SELECT);
    }
    updateFileInfos();