-
Notifications
You must be signed in to change notification settings - Fork 5.7k
fix(outputs.influxdb_v2): Correct calculation of amount of batches for concurrent writes #18014
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
fix(outputs.influxdb_v2): Correct calculation of amount of batches for concurrent writes #18014
Conversation
67e750f to
1f81ae2
Compare
srebhan
left a comment
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 catching this @AndrewChubatiuk! Only one request to move your testing into an own test-function to not distort the benchmarks!
1f81ae2 to
31eea20
Compare
srebhan
left a comment
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 a lot @AndrewChubatiuk!
skartikey
left a comment
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.
@AndrewChubatiuk Thanks! A couple of minor comments.
31eea20 to
a912da5
Compare
|
@skartikey thanks for review |
|
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
skartikey
left a comment
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.
@AndrewChubatiuk Thanks for the contribution!
Summary
in influxdb_v2 output with
concurrent_writes> 1 part of data may be droppedhere algorithm calculates a size of buffer dividing amount of metrics by workers count and increments by one if remainder is > 0, but this is not taken into account during calculation of batches count inside
createBatches.In current implementation with metrics slice of size
100kand concurrent_writes set to13telegraf drops7684items(100000 // ⌈100000/13⌉) * ⌈100000/13⌉= (100000//7693) * 7693 = 12 * 7693 = 92316Checklist