From 21a970df834a89946bc74f492e5409a7f2859af6 Mon Sep 17 00:00:00 2001 From: PengFei Li Date: Wed, 13 Sep 2023 14:53:17 +0800 Subject: [PATCH] [Enhancement] Reuse the label for retry to avoid duplicate load (#284) Signed-off-by: PengFei Li --- .../starrocks/data/load/stream/v2/TransactionTableRegion.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/starrocks-stream-load-sdk/src/main/java/com/starrocks/data/load/stream/v2/TransactionTableRegion.java b/starrocks-stream-load-sdk/src/main/java/com/starrocks/data/load/stream/v2/TransactionTableRegion.java index fa6ce88d..dd395e00 100644 --- a/starrocks-stream-load-sdk/src/main/java/com/starrocks/data/load/stream/v2/TransactionTableRegion.java +++ b/starrocks-stream-load-sdk/src/main/java/com/starrocks/data/load/stream/v2/TransactionTableRegion.java @@ -125,6 +125,10 @@ public LabelGenerator getLabelGenerator() { @Override public void setLabel(String label) { + // Reuse the same label to avoid duplicate load if retry happens + if (numRetries > 0 && label != null) { + return; + } this.label = label; }