Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context has expired in SetOrJoinSink::consume (when writing through MV) #63900

Open
tavplubix opened this issue May 15, 2024 · 0 comments
Open
Labels
fuzz Problem found by one of the fuzzers

Comments

@tavplubix
Copy link
Member

https://s3.amazonaws.com/clickhouse-test-reports/63549/9eaf9004b76dc2b4f3f2e596390eb7338a656cad/stress_test__tsan_.html

It's a query context, looks like we forgot addInterpreterContext (or lost it when building pipeline)

2730429:2024.05.14 23:08:48.819765 [ 3169 ] {5439629e-ee0b-40b8-a1f8-9ce099bf8cc3} <Debug> executeQuery: (from [::1]:51584) (comment: 01111_create_drop_replicated_db_stress.sh) insert into test_3.mv_to_set values  (stage: Complete)
2730435:2024.05.14 23:08:48.827097 [ 3169 ] {5439629e-ee0b-40b8-a1f8-9ce099bf8cc3} <Fatal> : Logical error: 'Context has expired'.

Trivial to reproduce:

localhost.localdomain :) CREATE TABLE destination_join ( `key` String, `id` String, `color` String, `section` String, `description` String) ENGINE = Join(ANY, LEFT, key);

CREATE TABLE destination_join
(
    `key` String,
    `id` String,
    `color` String,
    `section` String,
    `description` String
)
ENGINE = Join(ANY, LEFT, key)

Query id: 14b9a8f4-7bd5-4c0b-847b-d1fdab3c44f4

Ok.

0 rows in set. Elapsed: 0.011 sec. 

localhost.localdomain :) CREATE TABLE destination_set (`key` String) ENGINE = Set;

CREATE TABLE destination_set
(
    `key` String
)
ENGINE = Set

Query id: ef5876a2-afe6-42df-9c18-2fe636283245

Ok.

0 rows in set. Elapsed: 0.011 sec. 

localhost.localdomain :) CREATE MATERIALIZED VIEW mv_to_set TO `destination_set` AS SELECT key FROM destination_join;

CREATE MATERIALIZED VIEW mv_to_set TO destination_set
AS SELECT key
FROM destination_join

Query id: 297bfcf8-f1fd-4541-8aeb-0ad442460707

Ok.

0 rows in set. Elapsed: 0.020 sec. 

localhost.localdomain :) show create mv_to_set

SHOW CREATE TABLE mv_to_set

Query id: 75a6791b-ba5d-4bd7-b1b7-dc4d76180701

   ┌─statement─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
1. │ CREATE MATERIALIZED VIEW default.mv_to_set TO default.destination_set
(
    `key` String
)
AS SELECT key
FROM default.destination_join │
   └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

1 row in set. Elapsed: 0.006 sec. 

localhost.localdomain :) insert into mv_to_set values ('kek')

INSERT INTO mv_to_set FORMAT Values

Query id: bdb25057-ee4f-473e-82e9-706707fc425f

[dell9510] 2024.05.15 20:28:05.998679 [ 1001841 ] {bdb25057-ee4f-473e-82e9-706707fc425f} <Fatal> : Logical error: 'Context has expired'.
[dell9510] 2024.05.15 20:28:06.001328 [ 1003119 ] <Fatal> BaseDaemon: ########################################
[dell9510] 2024.05.15 20:28:06.001592 [ 1003119 ] <Fatal> BaseDaemon: (version 24.5.1.1, build id: 58ADCA61B624305C55E4EAED3C1F1B87913CDAA7, git hash: 8bb24e6a369886b3ac734a94fedef3046e05eb4b) (from thread 1001841) (query_id: bdb25057-ee4f-473e-82e9-706707fc425f) (query: insert into mv_to_set values ) Received signal Aborted (6)
[dell9510] 2024.05.15 20:28:06.001840 [ 1003119 ] <Fatal> BaseDaemon: 
[dell9510] 2024.05.15 20:28:06.002008 [ 1003119 ] <Fatal> BaseDaemon: Stack trace: 0x00007fb5cc82c194 0x00007fb5cc7d8d70 0x00007fb5cc7c04c0 0x00000000140cec3a 0x00000000140cedf5 0x00000000140cf491 0x000000000a8f4af7 0x000000000a8f1ca9 0x000000000a8fab2a 0x000000000a9340bb 0x000000001e413f17 0x000000001fc5b451 0x000000001fab7cc9 0x000000001fab7c75 0x000000001fab7c55 0x000000001fab7c35 0x000000001fab7bfd 0x0000000012815f36 0x0000000012815ad5 0x000000001fab73c5 0x000000001fab6d66 0x000000001f4e5b19 0x000000001f4e57e1 0x000000001f4c415e 0x000000001f4c3b7e 0x000000001f4f627e 0x000000001f41b00a 0x000000001f417c84 0x000000001f40e0eb 0x000000001f424f92 0x0000000024199619 0x0000000024199e5d 0x00000000243a1b01 0x000000002439e2fa 0x000000002439cd55 0x00007fb5cc82a1cf 0x00007fb5cc8ab6ec
[dell9510] 2024.05.15 20:28:06.002236 [ 1003119 ] <Fatal> BaseDaemon: 4. ? @ 0x00007fb5cc82c194
[dell9510] 2024.05.15 20:28:06.002403 [ 1003119 ] <Fatal> BaseDaemon: 5. ? @ 0x00007fb5cc7d8d70
[dell9510] 2024.05.15 20:28:06.002640 [ 1003119 ] <Fatal> BaseDaemon: 6. ? @ 0x00007fb5cc7c04c0
[dell9510] 2024.05.15 20:28:06.216519 [ 1003119 ] <Fatal> BaseDaemon: 7. /home/tavplubix/ch/ClickHouse/src/Common/Exception.cpp:0: DB::abortOnFailedAssertion(String const&) @ 0x00000000140cec3a
[dell9510] 2024.05.15 20:28:06.292680 [ 1003119 ] <Fatal> BaseDaemon: 8. /home/tavplubix/ch/ClickHouse/src/Common/Exception.cpp:65: DB::handle_error_code(String const&, int, bool, std::vector<void*, std::allocator<void*>> const&) @ 0x00000000140cedf5
[dell9510] 2024.05.15 20:28:06.359397 [ 1003119 ] <Fatal> BaseDaemon: 9. /home/tavplubix/ch/ClickHouse/src/Common/Exception.cpp:105: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x00000000140cf491
[dell9510] 2024.05.15 20:28:06.426539 [ 1003119 ] <Fatal> BaseDaemon: 10. /home/tavplubix/ch/ClickHouse/src/Common/Exception.h:95: DB::Exception::Exception(String&&, int, bool) @ 0x000000000a8f4af7
[dell9510] 2024.05.15 20:28:06.490190 [ 1003119 ] <Fatal> BaseDaemon: 11. /home/tavplubix/ch/ClickHouse/src/Common/Exception.h:68: DB::Exception::Exception(PreformattedMessage&&, int) @ 0x000000000a8f1ca9
[dell9510] 2024.05.15 20:28:06.556766 [ 1003119 ] <Fatal> BaseDaemon: 12. /home/tavplubix/ch/ClickHouse/src/Common/Exception.h:113: DB::Exception::Exception<>(int, FormatStringHelperImpl<>) @ 0x000000000a8fab2a
[dell9510] 2024.05.15 20:28:06.654133 [ 1003119 ] <Fatal> BaseDaemon: 13. /home/tavplubix/ch/ClickHouse/src/Interpreters/Context_fwd.h:42: DB::WithContextImpl<std::shared_ptr<DB::Context const>>::getContext() const @ 0x000000000a9340bb
[dell9510] 2024.05.15 20:28:07.090853 [ 1003119 ] <Fatal> BaseDaemon: 14. /home/tavplubix/ch/ClickHouse/src/Storages/StorageSet.cpp:89: DB::SetOrJoinSink::consume(DB::Chunk) @ 0x000000001e413f17
[dell9510] 2024.05.15 20:28:07.150733 [ 1003119 ] <Fatal> BaseDaemon: 15. /home/tavplubix/ch/ClickHouse/src/Processors/Sinks/SinkToStorage.cpp:18: DB::SinkToStorage::onConsume(DB::Chunk) @ 0x000000001fc5b451
[dell9510] 2024.05.15 20:28:07.247298 [ 1003119 ] <Fatal> BaseDaemon: 16. /home/tavplubix/ch/ClickHouse/src/Processors/Transforms/ExceptionKeepingTransform.cpp:150: DB::ExceptionKeepingTransform::work()::$_1::operator()() const @ 0x000000001fab7cc9
[dell9510] 2024.05.15 20:28:07.313733 [ 1003119 ] <Fatal> BaseDaemon: 17. /home/tavplubix/ch/ClickHouse/contrib/llvm-project/libcxx/include/__functional/invoke.h:394: ? @ 0x000000001fab7c75
[dell9510] 2024.05.15 20:28:07.379407 [ 1003119 ] <Fatal> BaseDaemon: 18. /home/tavplubix/ch/ClickHouse/contrib/llvm-project/libcxx/include/__functional/invoke.h:480: ? @ 0x000000001fab7c55
[dell9510] 2024.05.15 20:28:07.444461 [ 1003119 ] <Fatal> BaseDaemon: 19. /home/tavplubix/ch/ClickHouse/contrib/llvm-project/libcxx/include/__functional/function.h:235: ? @ 0x000000001fab7c35
[dell9510] 2024.05.15 20:28:07.508736 [ 1003119 ] <Fatal> BaseDaemon: 20. /home/tavplubix/ch/ClickHouse/contrib/llvm-project/libcxx/include/__functional/function.h:716: ? @ 0x000000001fab7bfd
[dell9510] 2024.05.15 20:28:07.646240 [ 1003119 ] <Fatal> BaseDaemon: 21. /home/tavplubix/ch/ClickHouse/contrib/llvm-project/libcxx/include/__functional/function.h:848: ? @ 0x0000000012815f36
[dell9510] 2024.05.15 20:28:07.769005 [ 1003119 ] <Fatal> BaseDaemon: 22. /home/tavplubix/ch/ClickHouse/contrib/llvm-project/libcxx/include/__functional/function.h:1187: ? @ 0x0000000012815ad5
[dell9510] 2024.05.15 20:28:07.835799 [ 1003119 ] <Fatal> BaseDaemon: 23. /home/tavplubix/ch/ClickHouse/src/Processors/Transforms/ExceptionKeepingTransform.cpp:114: DB::runStep(std::function<void ()>, DB::ThreadStatus*, std::atomic<unsigned long>*) @ 0x000000001fab73c5
[dell9510] 2024.05.15 20:28:07.884373 [ 1003119 ] <Fatal> BaseDaemon: 24. /home/tavplubix/ch/ClickHouse/src/Processors/Transforms/ExceptionKeepingTransform.cpp:150: DB::ExceptionKeepingTransform::work() @ 0x000000001fab6d66
[dell9510] 2024.05.15 20:28:07.938140 [ 1003119 ] <Fatal> BaseDaemon: 25. /home/tavplubix/ch/ClickHouse/src/Processors/Executors/ExecutionThreadContext.cpp:47: DB::executeJob(DB::ExecutingGraph::Node*, DB::ReadProgressCallback*) @ 0x000000001f4e5b19
[dell9510] 2024.05.15 20:28:07.971582 [ 1003119 ] <Fatal> BaseDaemon: 26. /home/tavplubix/ch/ClickHouse/src/Processors/Executors/ExecutionThreadContext.cpp:96: DB::ExecutionThreadContext::executeTask() @ 0x000000001f4e57e1
[dell9510] 2024.05.15 20:28:08.093016 [ 1003119 ] <Fatal> BaseDaemon: 27. /home/tavplubix/ch/ClickHouse/src/Processors/Executors/PipelineExecutor.cpp:273: DB::PipelineExecutor::executeStepImpl(unsigned long, std::atomic<bool>*) @ 0x000000001f4c415e
[dell9510] 2024.05.15 20:28:08.176389 [ 1003119 ] <Fatal> BaseDaemon: 28. /home/tavplubix/ch/ClickHouse/src/Processors/Executors/PipelineExecutor.cpp:148: DB::PipelineExecutor::executeStep(std::atomic<bool>*) @ 0x000000001f4c3b7e
[dell9510] 2024.05.15 20:28:08.229683 [ 1003119 ] <Fatal> BaseDaemon: 29. /home/tavplubix/ch/ClickHouse/src/Processors/Executors/PushingPipelineExecutor.cpp:123: DB::PushingPipelineExecutor::finish() @ 0x000000001f4f627e
[dell9510] 2024.05.15 20:28:08.634142 [ 1003119 ] <Fatal> BaseDaemon: 30. /home/tavplubix/ch/ClickHouse/src/Server/TCPHandler.cpp:930: auto DB::TCPHandler::processInsertQuery()::$_0::operator()<DB::PushingPipelineExecutor>(DB::PushingPipelineExecutor&, DB::Block) const @ 0x000000001f41b00a
[dell9510] 2024.05.15 20:28:08.884682 [ 1003119 ] <Fatal> BaseDaemon: 31. /home/tavplubix/ch/ClickHouse/src/Server/TCPHandler.cpp:997: DB::TCPHandler::processInsertQuery() @ 0x000000001f417c84
[dell9510] 2024.05.15 20:28:09.121702 [ 1003119 ] <Fatal> BaseDaemon: 32. /home/tavplubix/ch/ClickHouse/src/Server/TCPHandler.cpp:539: DB::TCPHandler::runImpl() @ 0x000000001f40e0eb
[dell9510] 2024.05.15 20:28:09.384846 [ 1003119 ] <Fatal> BaseDaemon: 33. /home/tavplubix/ch/ClickHouse/src/Server/TCPHandler.cpp:2341: DB::TCPHandler::run() @ 0x000000001f424f92
[dell9510] 2024.05.15 20:28:09.429254 [ 1003119 ] <Fatal> BaseDaemon: 34. /home/tavplubix/ch/ClickHouse/base/poco/Net/src/TCPServerConnection.cpp:43: Poco::Net::TCPServerConnection::start() @ 0x0000000024199619
[dell9510] 2024.05.15 20:28:09.469040 [ 1003119 ] <Fatal> BaseDaemon: 35. /home/tavplubix/ch/ClickHouse/base/poco/Net/src/TCPServerDispatcher.cpp:115: Poco::Net::TCPServerDispatcher::run() @ 0x0000000024199e5d
[dell9510] 2024.05.15 20:28:09.515324 [ 1003119 ] <Fatal> BaseDaemon: 36. /home/tavplubix/ch/ClickHouse/base/poco/Foundation/src/ThreadPool.cpp:188: Poco::PooledThread::run() @ 0x00000000243a1b01
[dell9510] 2024.05.15 20:28:09.548373 [ 1003119 ] <Fatal> BaseDaemon: 37. /home/tavplubix/ch/ClickHouse/base/poco/Foundation/src/Thread.cpp:46: Poco::(anonymous namespace)::RunnableHolder::run() @ 0x000000002439e2fa
[dell9510] 2024.05.15 20:28:09.571626 [ 1003119 ] <Fatal> BaseDaemon: 38. /home/tavplubix/ch/ClickHouse/base/poco/Foundation/src/Thread_POSIX.cpp:335: Poco::ThreadImpl::runnableEntry(void*) @ 0x000000002439cd55
[dell9510] 2024.05.15 20:28:09.571966 [ 1003119 ] <Fatal> BaseDaemon: 39. ? @ 0x00007fb5cc82a1cf
[dell9510] 2024.05.15 20:28:09.572257 [ 1003119 ] <Fatal> BaseDaemon: 40. ? @ 0x00007fb5cc8ab6ec
[dell9510] 2024.05.15 20:28:09.572456 [ 1003119 ] <Fatal> BaseDaemon: Integrity check of the executable skipped because the reference checksum could not be read.
[dell9510] 2024.05.15 20:28:12.420330 [ 1003119 ] <Fatal> BaseDaemon: This ClickHouse version is not official and should be upgraded to the official build.
[dell9510] 2024.05.15 20:28:12.420794 [ 1003119 ] <Fatal> BaseDaemon: Changed settings: stream_like_engine_allow_direct_select = true, log_queries = true, distributed_ddl_task_timeout = 30, query_profiler_real_time_period_ns = 1000000000, query_profiler_cpu_time_period_ns = 1000000000, allow_experimental_analyzer = true, show_table_uuid_in_table_create_query_if_not_nil = false, database_atomic_wait_for_drop_and_detach_synchronously = true, database_replicated_initial_query_timeout_sec = 30, database_replicated_always_detach_permanently = true, distributed_ddl_output_mode = 'none', distributed_ddl_entry_format_version = 6, allow_experimental_shared_merge_tree = true, allow_experimental_database_replicated = true, background_pool_size = 16, default_database_engine = 'Atomic'
Exception on client:
Code: 32. DB::Exception: Attempt to read after eof: while receiving packet from localhost:9000. (ATTEMPT_TO_READ_AFTER_EOF)

Connecting to localhost:9000 as user default.
Code: 210. DB::NetException: Connection refused (localhost:9000). (NETWORK_ERROR)

Broken since 24.2: https://fiddle.clickhouse.com/3855cc94-704e-4afc-9f30-6001c7ee046d

@tavplubix tavplubix added the fuzz Problem found by one of the fuzzers label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fuzz Problem found by one of the fuzzers
Projects
None yet
Development

No branches or pull requests

1 participant