Merge pull request #44349 from hanfei1991/hanfei/fix-async-flaky

fix flack test "02481_async_insert_dedup"
This commit is contained in:
Han Fei 2022-12-19 21:53:15 +01:00 committed by GitHub
commit 5a6cdd4825
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 8 deletions

View File

@ -485,7 +485,8 @@ void ReplicatedMergeTreeSinkImpl<true>::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 duplicate block IDs: {}, retry times {}", toString(conflict_block_ids), retry_times);
/// partition clean conflict
rewriteBlock(log, partition, conflict_block_ids);
if (partition.block_id.empty())

View File

@ -104,13 +104,17 @@ while (True):
result = result.split()
err = False
errMsg = ""
for i in range(total_number):
expect = str(i+1)
real = result[i]
if expect != real:
err = True
errMsg = "error, {} is not equal to {} for {}-th elements, total rows is {}".format(real, expect, i, len(result))
break
if len(result) != total_number:
err = True
errMsg = f"the size of result is {len(result)}. we expect {total_number}."
else:
for i in range(total_number):
expect = str(i+1)
real = result[i]
if expect != real:
err = True
errMsg = f"error, real value {real} is not equal to expect value {expect} for {i}-th elements"
break
# retry several times to get stable results.
if err and retry >= 5:
print (errMsg, flush=True)