yihua commented on code in PR #8319:
URL: https://github.com/apache/hudi/pull/8319#discussion_r1172071709
##########
hudi-utilities/src/test/java/org/apache/hudi/utilities/deltastreamer/TestHoodieDeltaStreamer.java:
##########
@@ -1088,28 +1088,30 @@ public void
testCleanerDeleteReplacedDataWithArchive(Boolean asyncClean, HoodieR
assertFalse(replacedFilePaths.isEmpty());
- // Step 4 : Insert 1 record and trigger sync/async cleaner and archive.
- List<String> configs = getAsyncServicesConfigs(1, "true", "true", "6", "",
"");
- configs.add(String.format("%s=%s", HoodieCleanConfig.CLEANER_POLICY.key(),
"KEEP_LATEST_COMMITS"));
- configs.add(String.format("%s=%s",
HoodieCleanConfig.CLEANER_COMMITS_RETAINED.key(), "1"));
- configs.add(String.format("%s=%s",
HoodieArchivalConfig.MIN_COMMITS_TO_KEEP.key(), "2"));
- configs.add(String.format("%s=%s",
HoodieArchivalConfig.MAX_COMMITS_TO_KEEP.key(), "3"));
- configs.add(String.format("%s=%s", HoodieCleanConfig.ASYNC_CLEAN.key(),
asyncClean));
- configs.add(String.format("%s=%s",
HoodieMetadataConfig.COMPACT_NUM_DELTA_COMMITS.key(), "1"));
- configs.add(String.format("%s=%s", HoodieWriteConfig.MARKERS_TYPE.key(),
"DIRECT"));
- if (asyncClean) {
- configs.add(String.format("%s=%s",
HoodieWriteConfig.WRITE_CONCURRENCY_MODE.key(),
- WriteConcurrencyMode.OPTIMISTIC_CONCURRENCY_CONTROL.name()));
- configs.add(String.format("%s=%s",
HoodieCleanConfig.FAILED_WRITES_CLEANER_POLICY.key(),
- HoodieFailedWritesCleaningPolicy.LAZY.name()));
- configs.add(String.format("%s=%s",
HoodieLockConfig.LOCK_PROVIDER_CLASS_NAME.key(),
- InProcessLockProvider.class.getName()));
- }
- TestHelpers.addRecordMerger(recordType, configs);
- cfg.configs = configs;
- cfg.continuousMode = false;
- ds = new HoodieDeltaStreamer(cfg, jsc);
- ds.sync();
+ // Step 4 : Add commits with insert of 1 record and trigger sync/async
cleaner and archive.
+ for (int i = 0; i < 2; i++) {
+ List<String> configs = getAsyncServicesConfigs(1, "true", "true", "6",
"", "");
+ configs.add(String.format("%s=%s",
HoodieCleanConfig.CLEANER_POLICY.key(), "KEEP_LATEST_COMMITS"));
+ configs.add(String.format("%s=%s",
HoodieCleanConfig.CLEANER_COMMITS_RETAINED.key(), "1"));
Review Comment:
Make sense. Fixed.
##########
hudi-utilities/src/test/java/org/apache/hudi/utilities/sources/TestGcsEventsHoodieIncrSource.java:
##########
@@ -215,7 +215,7 @@ private HoodieRecord getGcsMetadataRecord(String
commitTime, String filename, St
private HoodieWriteConfig getWriteConfig() {
return getConfigBuilder(basePath(), metaClient)
-
.withArchivalConfig(HoodieArchivalConfig.newBuilder().archiveCommitsWith(2,
3).build())
+
.withArchivalConfig(HoodieArchivalConfig.newBuilder().archiveCommitsWith(4,
5).build())
.withCleanConfig(HoodieCleanConfig.newBuilder().retainCommits(1).build())
Review Comment:
We cannot set min archive commits to 2 anymore because the metadata table's
number of retained commits for cleaning is 3 and the metadata table's min
archive commits is the same as data table, so the min archive commits have to
be larger than 3 (number of retained commits for cleaning) now. That's why all
of the relevant tests have to be changed.
##########
hudi-utilities/src/test/java/org/apache/hudi/utilities/sources/TestHoodieIncrSource.java:
##########
@@ -96,7 +96,7 @@ public void testHoodieIncrSource(HoodieTableType tableType)
throws IOException {
this.tableType = tableType;
metaClient = getHoodieMetaClient(hadoopConf(), basePath());
HoodieWriteConfig writeConfig = getConfigBuilder(basePath(), metaClient)
-
.withArchivalConfig(HoodieArchivalConfig.newBuilder().archiveCommitsWith(2,
3).build())
+
.withArchivalConfig(HoodieArchivalConfig.newBuilder().archiveCommitsWith(4,
5).build())
Review Comment:
Same here.
--
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]