-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[HUDI-6174] Fixing flaky tests in HoodieDeltastreamer #8646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1109,15 +1109,31 @@ public void testCleanerDeleteReplacedDataWithArchive(Boolean asyncClean, HoodieR | |
| TestHelpers.addRecordMerger(recordType, configs); | ||
| cfg.configs = configs; | ||
| cfg.continuousMode = false; | ||
| // timeline as of now. no cleaner and archival kicked in. | ||
| // c1, c2, rc3, c4, c5, rc6, | ||
|
|
||
| for (int i = 0; i < 2; i++) { | ||
| ds = new HoodieDeltaStreamer(cfg, jsc); | ||
| ds.sync(); | ||
| } | ||
|
|
||
| // Step 5 : FirstReplaceHoodieInstant is retained for clean. | ||
| ds = new HoodieDeltaStreamer(cfg, jsc); | ||
| ds.sync(); | ||
| // after 1 round of sync, timeline will be as follows | ||
| // just before clean | ||
| // c1, c2, rc3, c4, c5, rc6, c7 | ||
| // after clean | ||
| // c1, c2, rc3, c4, c5, rc6, c7, c8.clean (earliest commit to retain is c7) | ||
| // after archival (retain 4 commits) | ||
| // c4, c5, rc6, c7, c8.clean | ||
|
|
||
| // old code has 2 sync() calls. book-keeping the sequence for now. | ||
| // after 2nd round of sync | ||
| // just before clean | ||
| // c4, c5, rc6, c7, c8.clean, c9 | ||
| // after clean | ||
| // c4, c5, rc6, c7, c8.clean, c9, c10.clean (earliest commit to retain c9) | ||
| // after archival | ||
| // c5, rc6, c7, c8.clean, c9, c10.clean | ||
|
|
||
| // Step 5 : FirstReplaceHoodieInstant should not be retained. | ||
| long count = meta.reloadActiveTimeline().getCompletedReplaceTimeline().getInstantsAsStream().filter(instant -> firstReplaceHoodieInstant.get().equals(instant)).count(); | ||
| assertEquals(1, count); | ||
| assertEquals(0, count); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want construct a test where the replacecommit should be retained?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nsivabalan I'll land this PR to unblock CI. Let's follow up on this.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure. |
||
|
|
||
| // Step 6 : All the replaced files in firstReplaceHoodieInstant should be deleted through sync/async cleaner. | ||
| for (String replacedFilePath : replacedFilePaths) { | ||
|
|
@@ -2387,7 +2403,7 @@ private void insertInTable(String tableBasePath, int count, WriteOperationType o | |
| if (cfg.configs == null) { | ||
| cfg.configs = new ArrayList<>(); | ||
| } | ||
| cfg.configs.add("hoodie.cleaner.commits.retained=3"); | ||
| cfg.configs.add("hoodie.cleaner.commits.retained=2"); | ||
| cfg.configs.add("hoodie.keep.min.commits=4"); | ||
| cfg.configs.add("hoodie.keep.max.commits=5"); | ||
| cfg.configs.add("hoodie.test.source.generate.inserts=true"); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nsivabalan @yihua
Can somebody explain it? What is the root cause of the changes in the results here? Why when we "insert data to table, will generate 5 active commits and 2 archived commits" get only 4 commits here?