Skip to content

Finalizing a writer before resetting it - #72382

Closed
tuanpach wants to merge 3 commits into
ClickHouse:masterfrom
tuanpach:fix-finialize-writer-before-resetting
Closed

tuanpach wants to merge 3 commits into
ClickHouse:masterfrom
tuanpach:fix-finialize-writer-before-resetting

Conversation

@tuanpach

@tuanpach tuanpach commented Nov 25, 2024 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

This CI job failed due to a writer which was resetting without finalizing, which triggered an assertion.

 [ 20738 ] {efa5557b-6674-460d-acf4-c1f3e9bfdb00} <Fatal> : Logical error: \'false && "WriteBuffer is neither finalized nor canceled in destructor."\'.
 [ 20738 ] {efa5557b-6674-460d-acf4-c1f3e9bfdb00} <Fatal> : Stack trace (when copying this message, always include the lines below):
 [ 27003 ] {} <Fatal> BaseDaemon: ########## Short fault info ############
 [ 27003 ] {} <Fatal> BaseDaemon: (version 24.12.1.59, build id: 24D6F5ADC409155D993C66D9532561A1C1B5EE13, git hash: d11113bcdd688c3c5a60929cd531704cab9e845e, architecture: x86_64) (from thread 20738) Received signal 6
 [ 27003 ] {} <Fatal> BaseDaemon: Signal description: Aborted
 [ 27003 ] {} <Fatal> BaseDaemon: 
 [ 27003 ] {} <Fatal> BaseDaemon: Stack trace: 0x0000557ad681c07d 0x0000557ad6ba8a82 0x0000557ace08b7a6 0x0000557ace08bcfb 0x00007f0b20d26520 0x00007f0b20d7a9fd 0x00007f0b20d26476 0x00007f0b20d0c7f3 0x0000557ace08a267 0x0000557ad67d6509 0x0000557ad67d67f7 0x0000557ad6890430 0x0000557ad69ffec9 0x0000
 [ 27003 ] {} <Fatal> BaseDaemon: ########################################
 [ 27003 ] {} <Fatal> BaseDaemon: (version 24.12.1.59, build id: 24D6F5ADC409155D993C66D9532561A1C1B5EE13, git hash: d11113bcdd688c3c5a60929cd531704cab9e845e) (from thread 20738) (query_id: efa5557b-6674-460d-acf4-c1f3e9bfdb00) (query: RESTORE DATABASE test_11_02911_keeper_map FROM Disk(\'backups\', \'
 [ 27003 ] {} <Fatal> BaseDaemon: 
 [ 27003 ] {} <Fatal> BaseDaemon: Stack trace: 0x0000557ad681c07d 0x0000557ad6ba8a82 0x0000557ace08b7a6 0x0000557ace08bcfb 0x00007f0b20d26520 0x00007f0b20d7a9fd 0x00007f0b20d26476 0x00007f0b20d0c7f3 0x0000557ace08a267 0x0000557ad67d6509 0x0000557ad67d67f7 0x0000557ad6890430 0x0000557ad69ffec9 0x0000
 [ 27003 ] {} <Fatal> BaseDaemon: 0.0. inlined from ./build_docker/./src/Common/StackTrace.cpp:380: StackTrace::tryCapture()
 [ 27003 ] {} <Fatal> BaseDaemon: 0. ./build_docker/./src/Common/StackTrace.cpp:349: StackTrace::StackTrace(ucontext_t const&) @ 0x000000000ff4007d
 [ 27003 ] {} <Fatal> BaseDaemon: 1. ./build_docker/./src/Common/SignalHandlers.cpp:85: signalHandler(int, siginfo_t*, void*) @ 0x00000000102cca82
 [ 27003 ] {} <Fatal> BaseDaemon: 2. __tsan::CallUserSignalHandler(__tsan::ThreadState*, bool, bool, int, __sanitizer::__sanitizer_siginfo*, void*) @ 0x00000000077af7a6
 [ 27003 ] {} <Fatal> BaseDaemon: 3. sighandler(int, __sanitizer::__sanitizer_siginfo*, void*) @ 0x00000000077afcfb
 [ 27003 ] {} <Fatal> BaseDaemon: 4. ? @ 0x00007f0b20d26520
 [ 27003 ] {} <Fatal> BaseDaemon: 5. ? @ 0x00007f0b20d7a9fd
 [ 27003 ] {} <Fatal> BaseDaemon: 6. ? @ 0x00007f0b20d26476
 [ 27003 ] {} <Fatal> BaseDaemon: 7. ? @ 0x00007f0b20d0c7f3
 [ 27003 ] {} <Fatal> BaseDaemon: 8. ___interceptor_abort @ 0x00000000077ae267
 [ 27003 ] {} <Fatal> BaseDaemon: 9. ./build_docker/./src/Common/Exception.cpp:48: DB::abortOnFailedAssertion(String const&, void* const*, unsigned long, unsigned long) @ 0x000000000fefa509
 [ 27003 ] {} <Fatal> BaseDaemon: 10. ./build_docker/./src/Common/Exception.cpp:54: DB::abortOnFailedAssertion(String const&) @ 0x000000000fefa7f7
 [ 27003 ] {} <Fatal> BaseDaemon: 11. ./build_docker/./src/IO/WriteBuffer.cpp:30: DB::WriteBuffer::~WriteBuffer() @ 0x000000000ffb4430
 [ 27003 ] {} <Fatal> BaseDaemon: 12.0. inlined from ./src/IO/BufferWithOwnMemory.h:150: ~BufferWithOwnMemory
 [ 27003 ] {} <Fatal> BaseDaemon: 12.1. inlined from ./src/IO/WriteBufferFromFileDescriptor.h:12: ~WriteBufferFromFileDescriptor
 [ 27003 ] {} <Fatal> BaseDaemon: 12. ./build_docker/./src/IO/WriteBufferFromFile.cpp:93: DB::WriteBufferFromFile::~WriteBufferFromFile() @ 0x0000000010123ec9
 [ 27003 ] {} <Fatal> BaseDaemon: 13. ./build_docker/./src/IO/WriteBufferFromFile.cpp:80: DB::WriteBufferFromFile::~WriteBufferFromFile() @ 0x0000000010123f3a
 [ 27003 ] {} <Fatal> BaseDaemon: 14.0. inlined from ./contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:48: std::default_delete<DB::WriteBufferFromFile>::operator()[abi:v15007](DB::WriteBufferFromFile*) const
 [ 27003 ] {} <Fatal> BaseDaemon: 14.1. inlined from ./contrib/llvm-project/libcxx/include/__memory/unique_ptr.h:305: std::unique_ptr<DB::WriteBufferFromFile, std::default_delete<DB::WriteBufferFromFile>>::reset[abi:v15007](DB::WriteBufferFromFile*)
 [ 27003 ] {} <Fatal> BaseDaemon: 14. ./build_docker/./src/Storages/StorageKeeperMap.cpp:1031: DB::StorageKeeperMap::restoreDataImpl(std::shared_ptr<DB::IBackup const> const&, String const&, std::shared_ptr<DB::WithRetries>, bool, std::shared_ptr<DB::IDisk> const&) @ 0x000000001a8fd7e5
 [ 27003 ] {} <Fatal> BaseDaemon: 15.0. inlined from ./build_docker/./src/Storages/StorageKeeperMap.cpp:1004: operator()
 [ 27003 ] {} <Fatal> BaseDaemon: 15.1. inlined from ./contrib/llvm-project/libcxx/include/__functional/invoke.h:394: ?
 [ 27003 ] {} <Fatal> BaseDaemon: 15.2. inlined from ./contrib/llvm-project/libcxx/include/__functional/invoke.h:479: ?
 [ 27003 ] {} <Fatal> BaseDaemon: 15.3. inlined from ./contrib/llvm-project/libcxx/include/__functional/function.h:235: ?
 [ 27003 ] {} <Fatal> BaseDaemon: 15. ./contrib/llvm-project/libcxx/include/__functional/function.h:716: ? @ 0x000000001a90f89a
 [ 27003 ] {} <Fatal> BaseDaemon: 16.0. inlined from ./contrib/llvm-project/libcxx/include/__functional/function.h:848: ?
 [ 27003 ] {} <Fatal> BaseDaemon: 16.1. inlined from ./contrib/llvm-project/libcxx/include/__functional/function.h:1197: ?
 [ 27003 ] {} <Fatal> BaseDaemon: 16.2. inlined from ./build_docker/./src/Backups/RestorerFromBackup.cpp:252: operator()
 [ 27003 ] {} <Fatal> BaseDaemon: 16.3. inlined from ./src/Common/threadPoolCallbackRunner.h:52: operator()
 [ 27003 ] {} <Fatal> BaseDaemon: 16.4. inlined from ./contrib/llvm-project/libcxx/include/__functional/invoke.h:394: ?
 [ 27003 ] {} <Fatal> BaseDaemon: 16. ./contrib/llvm-project/libcxx/include/future:1694: std::__packaged_task_func<std::function<std::future<void> (DB::RestorerFromBackup::schedule(std::function<void ()>&&, char const*)::$_0&&, Priority)> DB::threadPoolCallbackRunnerUnsafe<void, DB::RestorerFromBack
 [ 27003 ] {} <Fatal> BaseDaemon: 17.0. inlined from ./contrib/llvm-project/libcxx/include/future:1876: std::__packaged_task_function<void ()>::operator()() const
 [ 27003 ] {} <Fatal> BaseDaemon: 17. ./contrib/llvm-project/libcxx/include/future:2068: std::packaged_task<void ()>::operator()() @ 0x00000000106e92d5
 [ 27003 ] {} <Fatal> BaseDaemon: 18.0. inlined from ./src/Common/threadPoolCallbackRunner.h:59: operator()
 [ 27003 ] {} <Fatal> BaseDaemon: 18.1. inlined from ./contrib/llvm-project/libcxx/include/__functional/invoke.h:394: ?
 [ 27003 ] {} <Fatal> BaseDaemon: 18.2. inlined from ./contrib/llvm-project/libcxx/include/__functional/invoke.h:479: ?
 [ 27003 ] {} <Fatal> BaseDaemon: 18.3. inlined from ./contrib/llvm-project/libcxx/include/__functional/function.h:235: ?
 [ 27003 ] {} <Fatal> BaseDaemon: 18. ./contrib/llvm-project/libcxx/include/__functional/function.h:716: ? @ 0x00000000175399ed
 [ 27003 ] {} <Fatal> BaseDaemon: 19.0. inlined from ./contrib/llvm-project/libcxx/include/__functional/function.h:848: ?
 [ 27003 ] {} <Fatal> BaseDaemon: 19.1. inlined from ./contrib/llvm-project/libcxx/include/__functional/function.h:1197: ?
 [ 27003 ] {} <Fatal> BaseDaemon: 19. ./build_docker/./src/Common/ThreadPool.cpp:775: ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::worker() @ 0x000000001000a772
 [ 27003 ] {} <Fatal> BaseDaemon: 20.0. inlined from ./contrib/llvm-project/libcxx/include/__functional/invoke.h:359: ?
 [ 27003 ] {} <Fatal> BaseDaemon: 20.1. inlined from ./contrib/llvm-project/libcxx/include/tuple:1789: decltype(auto) std::__apply_tuple_impl[abi:v15007]<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&)(), std::tuple<ThreadPoolImpl<ThreadFromGlobalPoolImpl<false
 [ 27003 ] {} <Fatal> BaseDaemon: 20.2. inlined from ./contrib/llvm-project/libcxx/include/tuple:1798: decltype(auto) std::apply[abi:v15007]<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*&)(), std::tuple<ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::Thr
 [ 27003 ] {} <Fatal> BaseDaemon: 20. ./src/Common/ThreadPool.h:311: ThreadFromGlobalPoolImpl<false, true>::ThreadFromGlobalPoolImpl<void (ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool::*)(), ThreadPoolImpl<ThreadFromGlobalPoolImpl<false, true>>::ThreadFromThreadPool*>(
 [ 27003 ] {} <Fatal> BaseDaemon: 21.0. inlined from ./contrib/llvm-project/libcxx/include/__functional/invoke.h:394: ?
 [ 27003 ] {} <Fatal> BaseDaemon: 21.1. inlined from ./contrib/llvm-project/libcxx/include/__functional/invoke.h:479: ?
 [ 27003 ] {} <Fatal> BaseDaemon: 21.2. inlined from ./contrib/llvm-project/libcxx/include/__functional/function.h:235: ?
 [ 27003 ] {} <Fatal> BaseDaemon: 21. ./contrib/llvm-project/libcxx/include/__functional/function.h:716: ? @ 0x0000000010012162
 [ 27003 ] {} <Fatal> BaseDaemon: 22.0. inlined from ./contrib/llvm-project/libcxx/include/__functional/function.h:848: ?
 [ 27003 ] {} <Fatal> BaseDaemon: 22.1. inlined from ./contrib/llvm-project/libcxx/include/__functional/function.h:1197: ?
 [ 27003 ] {} <Fatal> BaseDaemon: 22. ./build_docker/./src/Common/ThreadPool.cpp:785: ThreadPoolImpl<std::thread>::ThreadFromThreadPool::worker() @ 0x00000000100071ae
 [ 27003 ] {} <Fatal> BaseDaemon: 23.0. inlined from ./contrib/llvm-project/libcxx/include/__functional/invoke.h:359: ?
 [ 27003 ] {} <Fatal> BaseDaemon: 23.1. inlined from ./contrib/llvm-project/libcxx/include/thread:284: void std::__thread_execute[abi:v15007]<std::unique_ptr<std::__thread_struct, std::default_delete<std::__thread_struct>>, void (ThreadPoolImpl<std::thread>::ThreadFromThreadPool::*)(), ThreadPoolImp
 [ 27003 ] {} <Fatal> BaseDaemon: 23. ./contrib/llvm-project/libcxx/include/thread:295: void* std::__thread_proxy[abi:v15007]<std::tuple<std::unique_ptr<std::__thread_struct, std::default_delete<std::__thread_struct>>, void (ThreadPoolImpl<std::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/

CI Settings (Only check the boxes if you know what you are doing):

  • Allow: All Required Checks
  • Allow: Stateless tests
  • Allow: Stateful tests
  • Allow: Integration Tests
  • Allow: Performance tests
  • Allow: All Builds
  • Allow: batch 1, 2 for multi-batch jobs
  • Allow: batch 3, 4, 5, 6 for multi-batch jobs

  • Exclude: Style check
  • Exclude: Fast test
  • Exclude: All with ASAN
  • Exclude: All with TSAN, MSAN, UBSAN, Coverage
  • Exclude: All with aarch64, release, debug

  • Run only fuzzers related jobs (libFuzzer fuzzers, AST fuzzers, etc.)
  • Exclude: AST fuzzers

  • Do not test
  • Woolen Wolfdog
  • Upload binaries for special builds
  • Disable merge-commit
  • Disable CI cache

@tuanpach tuanpach added the can be tested Allows running workflows for external contributors label Nov 25, 2024
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-not-for-changelog This PR should not be mentioned in the changelog label Nov 25, 2024
@robot-clickhouse-ci-1

robot-clickhouse-ci-1 commented Nov 25, 2024 •

Copy link
Copy Markdown
Contributor

This is an automated comment for commit 272432f with description of existing statuses. It's updated for the latest CI running

❌ Click here to open a full report in a separate page

Check nameDescriptionStatus
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc❌ failure
Successful checks
Check nameDescriptionStatus
AST fuzzerRuns randomly generated queries to catch program errors. The build type is optionally given in parenthesis. If it fails, ask a maintainer for help✅ success
BuildsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
ClickBenchRuns [ClickBench](https://github.com/ClickHouse/ClickBench/) with instant-attach table✅ success
Compatibility checkChecks that clickhouse binary runs on distributions with old libc versions. If it fails, ask a maintainer for help✅ success
Docker keeper imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docker server imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docs checkBuilds and tests the documentation✅ success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ success
Flaky testsChecks if new added or modified tests are flaky by running them repeatedly, in parallel, with more randomization. Functional tests are run 100 times with address sanitizer, and additional randomization of thread scheduling. Integration tests are run up to 10 times. If at least once a new test has failed, or was too long, this check will be red. We don't allow flaky tests, read the doc✅ success
Install packagesChecks that the built packages are installable in a clear environment✅ success
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests✅ success
Performance ComparisonMeasure changes in query performance. The performance test report is described in detail here. In square brackets are the optional part/total tests✅ success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors✅ success
Style checkRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success
Unit testsRuns the unit tests for different release types✅ success
Upgrade checkRuns stress tests on server version from last release and then tries to upgrade it to the version from the PR. It checks if the new server can successfully startup without any errors, crashes or sanitizer asserts✅ success

@antonio2368 antonio2368 self-assigned this Nov 25, 2024
@tuanpach
tuanpach enabled auto-merge November 27, 2024 05:53
@antonio2368 antonio2368 mentioned this pull request Dec 13, 2024
21 tasks
@antonio2368

Copy link
Copy Markdown
Member

#73279

auto-merge was automatically disabled December 16, 2024 09:41

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-not-for-changelog This PR should not be mentioned in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants