You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fluss.apache.org by ja...@apache.org on 2026/02/12 03:47:38 UTC
(fluss) branch main updated (90a3be3b1 -> 057bacc84)
This is an automated email from the ASF dual-hosted git repository.
jark pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/fluss.git
from 90a3be3b1 [lake/iceberg] support RowType conversion in FlussArrayAsIcebergList (#2649)
new fc9c52f61 [test] Fix flaky testUndoRecoveryMultipleKeys by checkpointing keyIndex in FailingCountingSource
new 057bacc84 [hotfix] Fix flaky testRescaleUp by fixing race condition in ProducerOffsetsStore.deleteSnapshot
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../sink/testutils/FailingCountingSource.java | 30 +++++++++++++++++-----
.../coordinator/producer/ProducerOffsetsStore.java | 9 ++++---
2 files changed, 30 insertions(+), 9 deletions(-)
(fluss) 02/02: [hotfix] Fix flaky testRescaleUp by fixing race condition in ProducerOffsetsStore.deleteSnapshot
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jark pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fluss.git
commit 057bacc84e80739af056d2fcc5eb2281e2f35684
Author: 白鵺 <oc...@alibaba-inc.com>
AuthorDate: Thu Feb 12 09:15:38 2026 +0800
[hotfix] Fix flaky testRescaleUp by fixing race condition in ProducerOffsetsStore.deleteSnapshot
Swap deletion order to delete ZK metadata before remote files, preventing
concurrent reads from finding metadata pointing to already-deleted files.
---
.../fluss/server/coordinator/producer/ProducerOffsetsStore.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/fluss-server/src/main/java/org/apache/fluss/server/coordinator/producer/ProducerOffsetsStore.java b/fluss-server/src/main/java/org/apache/fluss/server/coordinator/producer/ProducerOffsetsStore.java
index 107ed40c8..5551d93b3 100644
--- a/fluss-server/src/main/java/org/apache/fluss/server/coordinator/producer/ProducerOffsetsStore.java
+++ b/fluss-server/src/main/java/org/apache/fluss/server/coordinator/producer/ProducerOffsetsStore.java
@@ -199,13 +199,16 @@ public class ProducerOffsetsStore {
return;
}
- // Delete remote files
+ // Delete ZK metadata first so that concurrent reads won't find metadata
+ // pointing to already-deleted files. Orphan files (if any) will be cleaned
+ // up by the periodic cleanup task.
+ zkClient.deleteProducerOffsets(producerId);
+
+ // Then delete remote files
for (ProducerOffsets.TableOffsetMetadata metadata : optSnapshot.get().getTableOffsets()) {
deleteRemoteFile(metadata.getOffsetsPath());
}
- // Delete ZK metadata
- zkClient.deleteProducerOffsets(producerId);
LOG.info("Deleted snapshot for producer {}", producerId);
}
(fluss) 01/02: [test] Fix flaky testUndoRecoveryMultipleKeys by checkpointing keyIndex in FailingCountingSource
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jark pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fluss.git
commit fc9c52f6121deab4f49e1e905dc7f50e1273525a
Author: 白鵺 <oc...@alibaba-inc.com>
AuthorDate: Thu Feb 12 07:29:38 2026 +0800
[test] Fix flaky testUndoRecoveryMultipleKeys by checkpointing keyIndex in FailingCountingSource
keyIndex was not persisted in checkpoint state, causing round-robin key
distribution to shift after failover recovery, resulting in key1 receiving
an extra record (140 instead of expected 130).
---
.../sink/testutils/FailingCountingSource.java | 30 +++++++++++++++++-----
1 file changed, 24 insertions(+), 6 deletions(-)
diff --git a/fluss-flink/fluss-flink-common/src/test/java/org/apache/fluss/flink/sink/testutils/FailingCountingSource.java b/fluss-flink/fluss-flink-common/src/test/java/org/apache/fluss/flink/sink/testutils/FailingCountingSource.java
index b6a3e3aa9..8d29bc42e 100644
--- a/fluss-flink/fluss-flink-common/src/test/java/org/apache/fluss/flink/sink/testutils/FailingCountingSource.java
+++ b/fluss-flink/fluss-flink-common/src/test/java/org/apache/fluss/flink/sink/testutils/FailingCountingSource.java
@@ -234,11 +234,18 @@ public class FailingCountingSource
private final int splitId;
private final int emittedRecords;
private final boolean hasFailed;
+ private final int keyIndex;
public FailingCountingSplit(int splitId, int emittedRecords, boolean hasFailed) {
+ this(splitId, emittedRecords, hasFailed, 0);
+ }
+
+ public FailingCountingSplit(
+ int splitId, int emittedRecords, boolean hasFailed, int keyIndex) {
this.splitId = splitId;
this.emittedRecords = emittedRecords;
this.hasFailed = hasFailed;
+ this.keyIndex = keyIndex;
}
@Override
@@ -258,6 +265,10 @@ public class FailingCountingSource
return hasFailed;
}
+ public int getKeyIndex() {
+ return keyIndex;
+ }
+
@Override
public String toString() {
return "FailingCountingSplit{"
@@ -267,6 +278,8 @@ public class FailingCountingSource
+ emittedRecords
+ ", hasFailed="
+ hasFailed
+ + ", keyIndex="
+ + keyIndex
+ '}';
}
}
@@ -498,8 +511,9 @@ public class FailingCountingSource
@Override
public List<FailingCountingSplit> snapshotState(long checkpointId) {
- // Checkpoint the current state including hasFailed flag
- return Collections.singletonList(new FailingCountingSplit(0, totalEmitted, hasFailed));
+ // Checkpoint the current state including hasFailed flag and keyIndex
+ return Collections.singletonList(
+ new FailingCountingSplit(0, totalEmitted, hasFailed, keyIndex));
}
@Override
@@ -513,6 +527,7 @@ public class FailingCountingSource
for (FailingCountingSplit split : newSplits) {
this.totalEmitted = split.getEmittedRecords();
this.hasFailed = split.hasFailed();
+ this.keyIndex = split.getKeyIndex();
splits.add(split);
}
availableFuture.complete(null);
@@ -533,11 +548,12 @@ public class FailingCountingSource
/**
* Serializer for FailingCountingSplit.
*
- * <p>Serialization format: splitId (4 bytes) + emittedRecords (4 bytes) + hasFailed (1 byte)
+ * <p>Serialization format: splitId (4 bytes) + emittedRecords (4 bytes) + hasFailed (1 byte) +
+ * keyIndex (4 bytes)
*/
private static class FailingCountingSplitSerializer
implements SimpleVersionedSerializer<FailingCountingSplit> {
- private static final int VERSION = 1;
+ private static final int VERSION = 2;
@Override
public int getVersion() {
@@ -546,10 +562,11 @@ public class FailingCountingSource
@Override
public byte[] serialize(FailingCountingSplit split) {
- ByteBuffer buffer = ByteBuffer.allocate(9);
+ ByteBuffer buffer = ByteBuffer.allocate(13);
buffer.putInt(split.getSplitIdInt());
buffer.putInt(split.getEmittedRecords());
buffer.put((byte) (split.hasFailed() ? 1 : 0));
+ buffer.putInt(split.getKeyIndex());
return buffer.array();
}
@@ -559,7 +576,8 @@ public class FailingCountingSource
int splitId = buffer.getInt();
int emittedRecords = buffer.getInt();
boolean hasFailed = buffer.get() == 1;
- return new FailingCountingSplit(splitId, emittedRecords, hasFailed);
+ int keyIndex = version >= 2 ? buffer.getInt() : 0;
+ return new FailingCountingSplit(splitId, emittedRecords, hasFailed, keyIndex);
}
}