Skip to content

Commit ae8d7a5

Browse files
authored
Update ReplicatedMergeTreeSink.cpp
1 parent e07bb12 commit ae8d7a5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Storages/MergeTree/ReplicatedMergeTreeSink.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,8 +928,13 @@ std::pair<std::vector<String>, bool> ReplicatedMergeTreeSinkImpl<async_insert>::
928928
}
929929
else if (multi_code == Coordination::Error::ZNONODE && zkutil::getFailedOpIndex(multi_code, responses) == block_unlock_op_idx)
930930
{
931+
if (block_number_lock)
932+
throw Exception(ErrorCodes::QUERY_WAS_CANCELLED,
933+
"Insert query (for block {}) was canceled by concurrent ALTER PARTITION or TRUNCATE", block_number_lock->getPath());
934+
935+
chassert(!existing_part_name.empty());
931936
throw Exception(ErrorCodes::QUERY_WAS_CANCELLED,
932-
"Insert query (for block {}) was cancelled by concurrent ALTER PARTITION", block_number_lock->getPath());
937+
"Insert query (for existing part {}, deduplicated) was canceled by concurrent ALTER PARTITION, TRUNCATE, or the part became outdated", existing_part_name);
933938
}
934939
else if (Coordination::isHardwareError(multi_code))
935940
{

0 commit comments

Comments
 (0)