XuQianJin-Stars commented on code in PR #3518:
URL: https://github.com/apache/fluss/pull/3518#discussion_r3465663527
##########
fluss-lake/fluss-lake-hudi/src/test/java/org/apache/fluss/lake/hudi/tiering/HudiTieringTest.java:
##########
@@ -150,10 +149,24 @@ void testRejectCompactionWriteStatusesOnCommit() throws
Exception {
assertThatThrownBy(() -> committer.commit(committable,
Collections.emptyMap()))
.isInstanceOf(IOException.class)
- .hasMessageContaining("Hudi compaction write stats are not
supported yet");
+ .hasMessageContaining("Hudi write stats must contain
exactly one instant");
}
}
+ @Test
+ void testLatestCommittedInstantNeverGoesBackwards() {
+
assertThat(HudiLakeCommitter.getLatestCommittedInstant("20260624000200000",
null))
+ .isEqualTo("20260624000200000");
+ assertThat(
+ HudiLakeCommitter.getLatestCommittedInstant(
+ "20260624000200000", "20260624000100000"))
+ .isEqualTo("20260624000200000");
+ assertThat(
+ HudiLakeCommitter.getLatestCommittedInstant(
+ "20260624000200000", "20260624000300000"))
+ .isEqualTo("20260624000300000");
+ }
Review Comment:
After this rename the only remaining unit-level coverage of the new
compaction path is `getLatestCommittedInstant`. Please also add tests for:
- `commit()` with a committable that contains compaction stats (success path)
- `abort()` with both `writeStats` and `compactionWriteStats` populated,
asserting compaction is rolled back first
- `commitCompaction` with `totalErrorRecords > 0` and `IGNORE_FAILED=false`
(rollback path)
- `commitCompactionAndSchedule` where commit succeeds but schedule fails
(the failure should not break the data commit but should be observable
somewhere).
##########
fluss-lake/fluss-lake-hudi/src/test/java/org/apache/fluss/lake/hudi/tiering/HudiTieringITCase.java:
##########
@@ -121,6 +121,15 @@ void testTiering() throws Exception {
checkDataInHudiMORTable(pkTablePath, "", rows, 0);
checkFlussOffsetsInSnapshot(pkTablePath,
Collections.singletonMap(pkTableBucket, 9L));
+ rows = Arrays.asList(pkRow(1, "v1111"), pkRow(2, "v2222"),
pkRow(3, "v3333"));
+ writeRows(pkTablePath, rows, false);
+
+ // 3 current records + 3 delete records + 3 insert records.
+ assertReplicaStatus(pkTableBucket, 15);
+ checkDataInHudiMORTable(pkTablePath, "", rows, 0);
+ checkFlussOffsetsInSnapshot(pkTablePath,
Collections.singletonMap(pkTableBucket, 15L));
Review Comment:
The inline comment says '3 current + 3 delete + 3 insert' (= 9) but the
assertion is `15`. Please reconcile the comment so reviewers can verify the
math.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]