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

[FLINK-9920] Only check part files in BucketingSinkFaultToleranceITCase #7639

Closed
wants to merge 3 commits into from

Conversation

aljoscha
Copy link
Contributor

@aljoscha aljoscha commented Feb 1, 2019

No description provided.

Before, it could happen that other files are in the same directory. Then
the verification logic in the test would pick up those files and the
test would fail. Now we ignore all files that don't match our expected
pattern.
@aljoscha aljoscha requested a review from kl0u February 1, 2019 12:18
@aljoscha
Copy link
Contributor Author

aljoscha commented Feb 1, 2019

cc @Myasuka

@aljoscha
Copy link
Contributor Author

aljoscha commented Feb 1, 2019

Before, it could happen that other files are in the same directory. Then
the verification logic in the test would pick up those files and the
test would fail. Now we ignore all files that don't match our expected
pattern.

Copy link
Member

@Myasuka Myasuka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even we could make BucketingSinkFaultToleranceITCase not failing again, I think we should also clean up the test file created in RollingSink#reflectTruncate and BucketingSink#reflectTruncate before throwing the RuntimeException out, instead of just log error Could not create file for checking if truncate works.

// if (!file.getPath().getName().startsWith(PART_PREFIX)) {
// ignore files that don't match with our expected part prefix
// continue;
// }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented code should be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, this is the code I actually added. I must have commented out by accident.

@flinkbot
Copy link
Collaborator

flinkbot commented Feb 1, 2019

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Review Progress

  • ❌ 1. The [description] looks good.
  • ❌ 2. There is [consensus] that the contribution should go into to Flink.
  • ❔ 3. Needs [attention] from.
  • ❌ 4. The [architecture] is sound.
  • ❌ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot approve description to approve the 1st aspect (similarly, it also supports the consensus, architecture and quality keywords)
  • @flinkbot approve all to approve all aspects
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval

@rmetzger
Copy link
Contributor

rmetzger commented Feb 1, 2019

@aljoscha for approving the description, you need to send "@Flink bot approve description" (without the space)

@aljoscha
Copy link
Contributor Author

aljoscha commented Feb 4, 2019

@Myasuka I wrapped the whole checking logic in a try-finally-block. That should work. What do you think?

Copy link
Contributor

@kl0u kl0u left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work @aljoscha . I had some minor comments. Feel free to merge after integrating them.

"Could not create file for checking if truncate works. " +
"You can disable support for truncate() completely via " +
"BucketingSink.setUseTruncate(false).",
e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Move the e back to the previous line for uniformity.

fs.delete(testPath, false);
} catch (IOException e) {
LOG.error("Could not delete truncate test file.", e);
throw new RuntimeException("Could not delete truncate test file. " +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if we want to fail the job if we cannot delete the test file.
I would say it is enough to just log the fact and move on. If there is a bigger problem and this was not just a hick-up, the job will fail later when something that matters fails (e.g. we cannot create a tmp file).

What do you think @aljoscha ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, but I want to keep this change minimal. The decision a while back was to throw this exception and have users manually disable truncate if they want to get rid of the exception.

LOG.debug("Truncate is not supported.", e);
m = null;
}
try (FSDataOutputStream outputStream = fs.create(testPath)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments as above.

@aljoscha aljoscha closed this Feb 4, 2019
@aljoscha aljoscha deleted the fix-bucketingsink-itcase branch February 4, 2019 13:24
@aljoscha
Copy link
Contributor Author

aljoscha commented Feb 4, 2019

Merged

@Myasuka
Copy link
Member

Myasuka commented Feb 5, 2019

Sorry for not replying late, we just had the Chinese new year.

LGTM

@aljoscha
Copy link
Contributor Author

aljoscha commented Feb 5, 2019

No problem @Myasuka 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants