-
Notifications
You must be signed in to change notification settings - Fork 23
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
NETOBSERV-838 Group ingress+egress flows in same connection #387
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #387 +/- ##
==========================================
+ Coverage 60.89% 60.94% +0.04%
==========================================
Files 91 91
Lines 6281 6288 +7
==========================================
+ Hits 3825 3832 +7
Misses 2223 2223
Partials 233 233
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@ronensc please let me know if you are fine with that approach. The initial ticket suggested to rely on 2 hash ids but I feel it's less performant as we already have the duplicate field on flows. |
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.
@jpinsonneau I agree with you that this is much simpler and elegant than the approach suggested in the ticket.
@jotak , do you remember if there was a reason why we didn't follow this path the first place?
@@ -160,8 +160,10 @@ func (ct *conntrackImpl) prepareHeartbeatRecords() []config.GenericMap { | |||
|
|||
func (ct *conntrackImpl) updateConnection(conn connection, flowLog config.GenericMap, flowLogHash totalHashType) { | |||
d := ct.getFlowLogDirection(conn, flowLogHash) |
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.
I think the call to getFlowLogDirection()
could be moved under the new "if isn't duplicated"
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.
sure 👍
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.
flaky tests on data race => https://github.com/netobserv/flowlogs-pipeline/actions/runs/4185399722/jobs/7252391870
pkg/config/generic_map.go
Outdated
|
||
func (m GenericMap) IsDuplicate() bool { | ||
if duplicate, hasKey := m["Duplicate"]; hasKey { | ||
if isDuplicate, ok := duplicate.(bool); ok && isDuplicate { |
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.
We have ConvertToBool()
that can handle cases where the type of m["Duplicate"]
is not bool but is convertible to bool.
func ConvertToBool(unk interface{}) (bool, error) { |
I just noticed that ConvertToBool()
is missing the trivial case bool:
. If you think it's worth using ConvertToBool()
here, the fix of adding the trivial case could be done in this PR as well.
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.
I'm getting some conflicts when I try to import pipeline/utils
:
$ make build
/home/julien/dev/flowlogs-pipeline/bin/golangci-lint-v1.50.1 run --enable goimports --enable gofmt --enable ineffassign --timeout 5m
ERRO Running error: context loading failed: failed to load packages: failed to load with go/packages: internal error: go list gives conflicting information for package github.com/netobserv/flowlogs-pipeline/pkg/config [github.com/netobserv/flowlogs-pipeline/pkg/config.test]
make: *** [Makefile:70: lint] Error 3
Any idea ? Should we move utils
outside of the pipeline
package ?
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.
I think this errors implies a cyclic reference: config
imports pipeline/utils
and pipeline/utils
imports config
.
Looking at pipeline/utils
files, it seems that only batcher.go
has an import to config
.
"github.com/netobserv/flowlogs-pipeline/pkg/config" |
Hm... I'm not sure what would be the most proper solution in this case.
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.
Yeah so we should either move away Convert*
functions or batcher.go
from pipeline/utils
...
Or keep as is.
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.
I think I would go with the first option of moving convert.go
to an "FLP-independent" utils package.
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.
70514bf here we go
/retest |
rebased to pass the go |
@ronensc @jpinsonneau I haven't reviewed the code, but what does it mean "This PR skip duplicates in connection tracking aggregations." ? iirc we wanted to keep duplicated on purpose because it gives information about the network interfaces. But probably I don't have all the context, I will do a better review hopefully tomorrow |
Connection tracking implements aggregators ( This PR simply skip flows containing For performance reasons, we reuse |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jpinsonneau The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hmm ok this change looks good, but it doesn't address the "group ingress+egress" req, as the PR title shows, does it? Is there another PR for that? |
This PR skip duplicates in connection tracking aggregations.
It rely on
Duplicate
field provided by eBPF agent