Skip to content
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

Merged
merged 1 commit into from
Jun 19, 2023

Conversation

guanziyue
Copy link
Contributor

@guanziyue guanziyue commented Jun 17, 2023

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

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

@@ -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,
Copy link
Contributor

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.

Copy link
Contributor Author

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()) {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@hudi-bot
Copy link

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

@danny0405 danny0405 merged commit ea72350 into apache:master Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants