-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[HUDI-6401] should not throw exception when create marker file for lo… #9003
Conversation
@@ -296,7 +296,7 @@ protected class AppendLogWriteCallback implements HoodieLogFileWriteCallback { | |||
public boolean preLogFileOpen(HoodieLogFile logFileToAppend) { | |||
// we use create rather than createIfNotExists because create method can trigger marker-based early conflict detection. | |||
WriteMarkers writeMarkers = WriteMarkersFactory.get(config.getMarkersType(), hoodieTable, instantTime); | |||
return writeMarkers.create(partitionPath, logFileToAppend.getFileName(), IOType.APPEND, | |||
return writeMarkers.createIfNotExists(partitionPath, logFileToAppend.getFileName(), IOType.APPEND, |
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.
also needs to fix the comment.
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.
removed incorrect comment.
public Option<Path> createIfNotExists(String partitionPath, String fileName, IOType type, HoodieWriteConfig writeConfig, | ||
String fileId, HoodieActiveTimeline activeTimeline) { | ||
if (writeConfig.getWriteConcurrencyMode().supportsOptimisticConcurrencyControl() | ||
&& writeConfig.isEarlyConflictDetectionEnable()) { |
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.
can we change it to
&& writeConfig.getWriteConcurrencyMode().supportsOptimisticConcurrencyControl()
which is more efficient.
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.
Swap them in new commit.
Change Logs
Change method to create marker file for log file from create to create if not exists.
Impact
For spark jobs has task failed or speculation enabled, will throw exception when write log
Risk level (write none, low medium or high below)
low
Documentation Update
No need to update
Contributor's checklist