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

feat: batching write - exponential random backoff #83

Merged
merged 2 commits into from
Jun 17, 2021
Merged

Conversation

rhajek
Copy link
Contributor

@rhajek rhajek commented Jun 10, 2021

Proposed Changes

Improves exponential random retry strategy in write api like in python client influxdata/influxdb-client-python#225

Delay is computed using random exponential backoff as a random value within the interval retryInterval * exponentialBase^(attempts-1) and retryInterval * exponentialBase^(attempts).

Example for retryInterval=5_000, exponentialBase=2, maxRetryDelay=125_000, total=5

Retry delays are random distributed values within the ranges of [5_000-10_000, 10_000-20_000, 20_000-40_000, 40_000-80_000, 80_000-125_000]

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • rake test completes successfully
  • Commit messages are in semantic format
  • Sign CLA (if not already signed)

@codecov-commenter
Copy link

codecov-commenter commented Jun 10, 2021

Codecov Report

Merging #83 (897a072) into master (b9ef186) will decrease coverage by 0.34%.
The diff coverage is 95.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #83      +/-   ##
==========================================
- Coverage   99.32%   98.98%   -0.35%     
==========================================
  Files          15       16       +1     
  Lines         742      785      +43     
==========================================
+ Hits          737      777      +40     
- Misses          5        8       +3     
Impacted Files Coverage Δ
lib/influxdb2/client/write_retry.rb 94.00% <94.00%> (ø)
lib/influxdb-client.rb 100.00% <100.00%> (ø)
lib/influxdb2/client/worker.rb 92.72% <100.00%> (-1.12%) ⬇️
lib/influxdb2/client/write_api.rb 100.00% <100.00%> (ø)

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 b9ef186...897a072. Read the comment docs.

@rhajek rhajek merged commit 06593de into master Jun 17, 2021
@rhajek rhajek deleted the feat/random-retry branch June 17, 2021 11:48
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