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

[BEAM-9742] Add Configurable FluentBackoff to JdbcIO Write #11396

Merged
merged 4 commits into from
Jun 10, 2020

Conversation

Akshay-Iyangar
Copy link
Contributor

Add Configurable FluentBackoff to JdbcIO Write
Jira ticket


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- Build Status --- --- Build Status
Java Build Status Build Status Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status Build Status
Build Status
Build Status
Python Build Status
Build Status
Build Status
Build Status
--- Build Status
Build Status
Build Status
Build Status
Build Status
--- --- Build Status
XLang --- --- --- Build Status --- --- Build Status

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website
Non-portable Build Status Build Status
Build Status
Build Status Build Status
Portable --- Build Status --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

@Akshay-Iyangar
Copy link
Contributor Author

* This is the default {@link FluentBackoffConfiguration} that we use to retry when a {@link
* SQLException} occurs.
*/
public static class DefaultFluentBackoffConfiguration implements FluentBackoffConfiguration {
Copy link
Member

Choose a reason for hiding this comment

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

We can't make FluentBackoff part of the public API surface since it is in the util package. It looks like other IO connectors have been creating their own RetryConfiguration class such as:
SnsIO:

public Write<T> withRetryConfiguration(RetryConfiguration retryConfiguration) {

SolrIO:
public abstract static class RetryConfiguration implements Serializable {

and then converting them to any internal implementation that makes sense.

Making FluentBackoff or a RetryConfiguration public and shared across implementation might make sense but warrants a discussion on the dev@ mailing list to see what the community thinks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lukecwik - cool! I will mail the dev group.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

It looks like we should stick with the pattern other IO authors have taken in the mean time.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @lukecwik - we should stay consistent with that.

@Akshay-Iyangar
Copy link
Contributor Author

@lukecwik @aromanenko-dev @jfarr @timrobertson100 Let me know what you guys think needs to be done.
Seems like people are ok with making FluentBackOff public?

@aromanenko-dev
Copy link
Contributor

Well, I didn't see any principal "against" to make FluentBackoff public but I'm not sure that it will be moved to another package or util will become public soon. So for now, I'd rather keep the same strategy as we did for other IOs by creating a custom RetryConfiguration for certain IO.
@lukecwik wdyt?

@lukecwik
Copy link
Member

lukecwik commented May 7, 2020 via email

@lukecwik
Copy link
Member

lukecwik commented May 7, 2020

Well, I didn't see any principal "against" to make FluentBackoff public but I'm not sure that it will be moved to another package or util will become public soon. So for now, I'd rather keep the same strategy as we did for other IOs by creating a custom RetryConfiguration for certain IO.
@lukecwik wdyt?

That makes sense to me. We can always expose it in the future and deprecate existing IO specific versions.

@chamikaramj chamikaramj requested a review from udim May 8, 2020 05:05
@udim
Copy link
Member

udim commented May 8, 2020

Hi, Cham requested that I take a look but I'm overloaded. Will attempt to look next week

@aromanenko-dev
Copy link
Contributor

@udim no problem, I can take over of this PR

@aromanenko-dev
Copy link
Contributor

Run Java PreCommit

Copy link
Contributor

@aromanenko-dev aromanenko-dev left a comment

Choose a reason for hiding this comment

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

@Akshay-Iyangar Following up the discussion here and on email thread, I propose to stay consistent with the RetryConfiguration pattern that was already used in other IO. Please, address this comments.

Also, please, rebase your feature branch against current master to avoid the merge commits there.

* This is the default {@link FluentBackoffConfiguration} that we use to retry when a {@link
* SQLException} occurs.
*/
public static class DefaultFluentBackoffConfiguration implements FluentBackoffConfiguration {
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @lukecwik - we should stay consistent with that.

@aromanenko-dev
Copy link
Contributor

Hi @Akshay-Iyangar, kind ping regarding this PR.

@Akshay-Iyangar
Copy link
Contributor Author

@aromanenko-dev - Sorry for a little busy, will make the changes today.

@Akshay-Iyangar Akshay-Iyangar reopened this Jun 2, 2020
@Akshay-Iyangar
Copy link
Contributor Author

@aromanenko-dev @lukecwik could you'll please have a look? Thanks

Copy link
Contributor

@aromanenko-dev aromanenko-dev left a comment

Choose a reason for hiding this comment

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

Thanks, it's almost LGTM. I left a couple of minor notes.

@aromanenko-dev
Copy link
Contributor

retest this please

@Akshay-Iyangar
Copy link
Contributor Author

@aromanenko-dev - Addressed the feedback !!

@aromanenko-dev
Copy link
Contributor

retest this please

@aromanenko-dev
Copy link
Contributor

Run Java PreCommit

2 similar comments
@aromanenko-dev
Copy link
Contributor

Run Java PreCommit

@aromanenko-dev
Copy link
Contributor

Run Java PreCommit

Copy link
Contributor

@aromanenko-dev aromanenko-dev left a comment

Choose a reason for hiding this comment

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

Thanks, it LGTM. I'm going to merge it once Java PreCommit will be green.
@lukecwik Do you have something to add?

@aromanenko-dev
Copy link
Contributor

Run Java PreCommit

3 similar comments
@Akshay-Iyangar
Copy link
Contributor Author

Run Java PreCommit

@aromanenko-dev
Copy link
Contributor

Run Java PreCommit

@aromanenko-dev
Copy link
Contributor

Run Java PreCommit

@aromanenko-dev
Copy link
Contributor

retest this please

@aromanenko-dev
Copy link
Contributor

I'm going to merge this PR since the failed test org.apache.beam.sdk.io.TextIOWriteTest.testWriteViaSink is not related to this change. All JdbcIO-related teste passed.

@aromanenko-dev aromanenko-dev merged commit 837b52f into apache:master Jun 10, 2020
yirutang pushed a commit to yirutang/beam that referenced this pull request Jul 23, 2020
)

* [BEAM-9742] revert back to the older version

* [BEAM-9742] Using retry configuration for fluent-backoff

* [BEAM-9742] fixing checkstyle errors.

* [BEAM-9742] Addressing feedback

Co-authored-by: aiyangar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants