-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[JdbcIO] - Adding option for max batch buffering duration #30259
Conversation
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
test failures here seem unrelated but I can't re-run, going to assign reviewers |
|
Assigning reviewers. If you would like to opt out of this review, comment R: @Abacn for label java. Available commands:
The PR bot will only process comments in the main thread (not review comments). |
Reviewers are already assigned to this PR: @Abacn @chamikaramj |
The idea sounds good to me. There are two options controlling the batch, batch_size and buffering_duration. For example, if batch_size set to 100 and buffering_duration=200ms.
If I understood correctly, in both cases, the pipeline will commit the buffer? Good to add some documentation about the spec. |
@Abacn yes exactly, so currently we can increase the batch size but not the max buffering duration. Each is a way to configure when the pipeline will commit the buffer. I can add documentation about this. |
@Abacn I added more to the javadoc for both |
Thanks. For the Spotless (formatting) check failure, please run |
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.
Thanks for the changes. Just had one comment
@@ -1971,6 +1982,7 @@ public PCollection<V> expand(PCollection<T> input) { | |||
.setRetryConfiguration(getRetryConfiguration()) | |||
.setReturnResults(true) | |||
.setBatchSize(1L) | |||
.setMaxBatchBufferingDuration(200L) |
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.
Use the constant (DEFAULT_MAX_BATCH_BUFFERING_DURATION) as it is defined there
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.
thanks, just made that change
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.
Thank you!
Currently the max buffering duration for batch processing during JDBC writes is not configurable and defaulted to 200ms. I'm proposing that we add an option to configure this setting to allow for a longer duration period to accumulate batched elements. We've run into an issue where batches are committed too frequently causing many small batches to be written rather than fewer larger batches, and I'm hoping to tweak this setting to allow for the latter.
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123
), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>
instead.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.