diff --git a/src/Storages/MergeTree/ReplicatedMergeTreeSink.cpp b/src/Storages/MergeTree/ReplicatedMergeTreeSink.cpp index 2d8bf28e700..a01ea2ab450 100644 --- a/src/Storages/MergeTree/ReplicatedMergeTreeSink.cpp +++ b/src/Storages/MergeTree/ReplicatedMergeTreeSink.cpp @@ -485,7 +485,8 @@ void ReplicatedMergeTreeSinkImpl::finishDelayedChunk(const ZooKeeperWithFa auto conflict_block_ids = commitPart(zookeeper, partition.temp_part.part, partition.block_id, delayed_chunk->replicas_num, false); if (conflict_block_ids.empty()) break; - LOG_DEBUG(log, "Found depulicate block IDs: {}, retry times {}", toString(conflict_block_ids), ++retry_times); + ++retry_times; + LOG_DEBUG(log, "Found depulicate block IDs: {}, retry times {}", toString(conflict_block_ids), retry_times); /// partition clean conflict rewriteBlock(log, partition, conflict_block_ids); if (partition.block_id.empty()) diff --git a/tests/queries/0_stateless/02481_async_insert_dedup.python b/tests/queries/0_stateless/02481_async_insert_dedup.python index 404165941b9..21cc3b5b401 100644 --- a/tests/queries/0_stateless/02481_async_insert_dedup.python +++ b/tests/queries/0_stateless/02481_async_insert_dedup.python @@ -106,6 +106,10 @@ while (True): errMsg = "" for i in range(total_number): expect = str(i+1) + if i >= len(result): + err = True + errMsg = "index {} is out of the size of result {}".format(i, len(result)) + break real = result[i] if expect != real: err = True