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

Fix aggregation bug for throughput common fields #324

Merged

Conversation

antoninbas
Copy link
Member

Just like for stats, throughput common fields should only be updated for the "latest" record (based on "flowEndSeconds").

This bug explains why the TestCollectorToIntermediate integration test has been flaky for a long time. In some cases, the record from the destination was processed before the record from the source (we have 2 aggregation workers, so records are not guaranteed to be processed in the order in which they are received). While the destination record has a larger "flowEndSeconds", the "throughput" and "reverseThroughput" common elements were overriden by values from the source record.

Just like for stats, throughput common fields should only be updated for
the "latest" record (based on "flowEndSeconds").

This bug explains why the TestCollectorToIntermediate integration test
has been flaky for a long time. In some cases, the record from the
destination was processed before the record from the source (we have 2
aggregation workers, so records are not guaranteed to be processed in
the order in which they are received). While the destination record has
a larger "flowEndSeconds", the "throughput" and "reverseThroughput"
common elements were overriden by values from the source record.

Signed-off-by: Antonin Bas <abas@vmware.com>
@codecov
Copy link

codecov bot commented Sep 30, 2023

Codecov Report

Merging #324 (ab987f9) into main (a678292) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #324      +/-   ##
==========================================
+ Coverage   73.48%   73.56%   +0.08%     
==========================================
  Files          18       18              
  Lines        2795     2796       +1     
==========================================
+ Hits         2054     2057       +3     
+ Misses        574      572       -2     
  Partials      167      167              
Flag Coverage Δ
integration-tests 51.54% <100.00%> (+0.03%) ⬆️
unit-tests 72.63% <100.00%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
pkg/intermediate/aggregate.go 72.60% <100.00%> (+0.05%) ⬆️

... and 1 file with indirect coverage changes

Copy link
Contributor

@heanlan heanlan left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks for the fix

Copy link

@dreamtalen dreamtalen left a comment

Choose a reason for hiding this comment

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

LGTM

@antoninbas antoninbas merged commit f5c5793 into vmware:main Oct 2, 2023
9 checks passed
dreamtalen pushed a commit to dreamtalen/go-ipfix that referenced this pull request Oct 2, 2023
Just like for stats, throughput common fields should only be updated for
the "latest" record (based on "flowEndSeconds").

This bug explains why the TestCollectorToIntermediate integration test
has been flaky for a long time. In some cases, the record from the
destination was processed before the record from the source (we have 2
aggregation workers, so records are not guaranteed to be processed in
the order in which they are received). While the destination record has
a larger "flowEndSeconds", the "throughput" and "reverseThroughput"
common elements were overriden by values from the source record.

Signed-off-by: Antonin Bas <abas@vmware.com>
dreamtalen pushed a commit that referenced this pull request Oct 2, 2023
Just like for stats, throughput common fields should only be updated for
the "latest" record (based on "flowEndSeconds").

This bug explains why the TestCollectorToIntermediate integration test
has been flaky for a long time. In some cases, the record from the
destination was processed before the record from the source (we have 2
aggregation workers, so records are not guaranteed to be processed in
the order in which they are received). While the destination record has
a larger "flowEndSeconds", the "throughput" and "reverseThroughput"
common elements were overriden by values from the source record.

Signed-off-by: Antonin Bas <abas@vmware.com>
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.

4 participants