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

Add fluent backoff support for ES #1826

Merged
merged 2 commits into from Apr 10, 2019

Conversation

regadas
Copy link
Contributor

@regadas regadas commented Apr 9, 2019

No description provided.

Implements retries when saving bulk documents to Elasticsearch.
This is useful for transient connection problems and other failures
which are temporary in nature.

The current behavior will cause the entire "Save to Elasticsearch" step
to fail and retry, which creates redundant saves to the cluster. There
is no existing method to enable a single failed chunk to retry.

This behavior is implemented with two new options, withMaxRetries and
withRetryPause, which can be passed in the configuration as "maxRetries"
and "retryPause" respectively.

Catch all exceptions within the chunks.forEach block.

Some of the exceptions thrown are not caught within the Client bulk() method.

Adds new params maxRetries and retryPause to saveAsElasticsearch method

Revert "Adds new params maxRetries and retryPause to saveAsElasticsearch method"

This exceeds the number of max params in scala style. So rely on it coming as cmdLine arg.

This reverts commit 00c299f.

Implements FluentBackoff

Implements @setup for ElasticsearchWriters, restores formatting

Restore indentation formatting on ES Bound constructors
@codecov
Copy link

codecov bot commented Apr 9, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@6183161). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1826   +/-   ##
=========================================
  Coverage          ?   70.62%           
=========================================
  Files             ?      190           
  Lines             ?     5869           
  Branches          ?      299           
=========================================
  Hits              ?     4145           
  Misses            ?     1724           
  Partials          ?        0
Impacted Files Coverage Δ
...m/spotify/scio/elasticsearch/ElasticsearchIO.scala 0% <0%> (ø)
...m/spotify/scio/elasticsearch/ElasticsearchIO.scala 0% <0%> (ø)
...m/spotify/scio/elasticsearch/ElasticsearchIO.scala 0% <0%> (ø)
...scala/com/spotify/scio/elasticsearch/package.scala 0% <0%> (ø)
...scala/com/spotify/scio/elasticsearch/package.scala 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6183161...0689f2b. Read the comment docs.

@regadas regadas marked this pull request as ready for review April 10, 2019 14:09
@regadas regadas merged commit 408e98c into spotify:master Apr 10, 2019
@regadas regadas deleted the elasticsearch-retries branch April 10, 2019 16:55
@soundofjw
Copy link

Woo! Glad to see this come in.
Also, hilarious this is exactly 200 PRs after my initial implementation in #1626

Thank you everyone!

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.

None yet

3 participants