Client not always throws an exception on server error during insert

未關閉
#406 2 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
cpp
領域
databases

研究方向

首先,使用 issue 中描述的伺服器端磁碟空間不足情境重現同步插入失敗,然後追蹤 C++ 用戶端如何處理伺服器回應。完成的標準是:伺服器端插入例外會傳遞給呼叫端,而不是靜默返回;如果現有測試設定支援此情況,請新增或執行回歸測試。

由索引模型根據 Issue 內容生成。

描述

bug needs-info

Hello!

I have a C++ code, which processes some data and repeatedly inserts the results to a clickhouse table. I have discovered that in some cases when insertion fails server-side, the client doesn't throw any exception and silently returns the control (inserts are made synchronously).

The latest server-side error, which haven't been handled by the C++ client, was caused by insufficient disk space, the stack trace is below:

0. DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x000000000e348c95 in /usr/bin/clickhouse
1. ? @ 0x000000001307a856 in /usr/bin/clickhouse
2. DB::MergeTreeData::reserveSpacePreferringTTLRules(std::shared_ptr<DB::StorageInMemoryMetadata const> const&, unsigned long, DB::MergeTreeDataPartTTLInfos const&, long, unsigned long, bool, std::shared_ptr<DB::IDisk>) const @ 0x0000000014850dbb in /usr/bin/clickhouse
3. DB::MergeTreeDataWriter::writeTempPartImpl(DB::BlockWithPartition&, std::shared_ptr<DB::StorageInMemoryMetadata const> const&, std::shared_ptr<DB::Context const>, long, bool) @ 0x00000000149f61c6 in /usr/bin/clickhouse
4. DB::MergeTreeSink::consume(DB::Chunk) @ 0x0000000014b818fc in /usr/bin/clickhouse
5. DB::SinkToStorage::onConsume(DB::Chunk) @ 0x0000000014ff6566 in /usr/bin/clickhouse
6. ? @ 0x0000000014f3dbeb in /usr/bin/clickhouse
7. ? @ 0x0000000014f3d91c in /usr/bin/clickhouse
8. DB::ExceptionKeepingTransform::work() @ 0x0000000014f3d1d8 in /usr/bin/clickhouse
9. DB::ExecutionThreadContext::executeTask() @ 0x0000000014d37d89 in /usr/bin/clickhouse
10. DB::PipelineExecutor::executeStepImpl(unsigned long, std::atomic<bool>*) @ 0x0000000014d2ea10 in /usr/bin/clickhouse
11. DB::PipelineExecutor::executeStep(std::atomic<bool>*) @ 0x0000000014d2e1c8 in /usr/bin/clickhouse
12. DB::PushingPipelineExecutor::push(DB::Chunk) @ 0x0000000014d40d15 in /usr/bin/clickhouse
13. DB::PushingPipelineExecutor::push(DB::Block) @ 0x0000000014d40f06 in /usr/bin/clickhouse
14. DB::TCPHandler::processInsertQuery() @ 0x0000000014cdd32a in /usr/bin/clickhouse
15. DB::TCPHandler::runImpl() @ 0x0000000014cd4760 in /usr/bin/clickhouse
16. DB::TCPHandler::run() @ 0x0000000014cea079 in /usr/bin/clickhouse
17. Poco::Net::TCPServerConnection::start() @ 0x0000000017c2fe34 in /usr/bin/clickhouse
18. Poco::Net::TCPServerDispatcher::run() @ 0x0000000017c31051 in /usr/bin/clickhouse
19. Poco::PooledThread::run() @ 0x0000000017dadd07 in /usr/bin/clickhouse
20. Poco::ThreadImpl::runnableEntry(void*) @ 0x0000000017dab73c in /usr/bin/clickhouse
21. start_thread @ 0x0000000000007fa3 in /usr/lib/x86_64-linux-gnu/libpthread-2.28.so
22. __clone @ 0x00000000000f906f in /usr/lib/x86_64-linux-gnu/libc-2.28.so

Is it possible to enable client-side exceptions on any server-side exception?

主要語言
C
星號
388
分支
220
平均合併
1 天 25 分鐘
30 天內合併 PR
16

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

ClickHouse/clickhouse-cpp 的其他 Issue

查看 ClickHouse/clickhouse-cpp 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。