Skip to content

Conversation

gandro
Copy link
Member

@gandro gandro commented Sep 22, 2020

This fixes a bug where a Hubble filter on reply=false would report flows
for which we actually do not know if they were replies or not. Not all
trace points have connection tracking state available, thus looking at
the reply flag alone is not sufficient to tell if something a flow was a
reply or not.

Ideally, we would fix this in the parser and make the reply an
optional boolean, so we can distinguish between a false value and an
absent value. This however is a breaking change in the Hubble API, which
we want to avoid. Therefore, this commit modifies the reply filter to
only report flows here for which we know that the reply field is
reliable.

Fixes a bug where a Hubble filter on `reply=false` would report flows for which the actual reply state is unknown.

Not all trace observation points have access to the connection tracking
state and populate the `Reason` field of `TraceNotify` accordingly. This
commit extracts a helper function to determine which trace points
currently do have access to connection tracking state.

Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
This fixes a bug in the reply filter on `reply=false` would report flows
for which we actually do not know if they were replies or not. Not all
trace points have connection tracking state available, thus looking at
the reply flag alone is not sufficent to tell if something a flow was a
reply or not.

Ideally, we would fix this in the parser and make the `reply` an
optional boolean, so we can distinguish between a `false` value and an
absent value. This however is a breaking change in the Hubble API, which
we want to avoid. Therefore, this commit modifies the reply filter to
only report flows here for which we know that the reply field is
reliable.

Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
@gandro gandro added release-note/bug This PR fixes an issue in a previous release of Cilium. area/hubble labels Sep 22, 2020
@gandro gandro requested a review from a team as a code owner September 22, 2020 14:28
@gandro gandro requested a review from a team September 22, 2020 14:28
@gandro
Copy link
Member Author

gandro commented Sep 22, 2020

test-me-please

@gandro
Copy link
Member Author

gandro commented Sep 23, 2020

retest-net-next

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Sep 23, 2020
@qmonnet qmonnet merged commit 511b15d into master Sep 23, 2020
@qmonnet qmonnet deleted the pr/gandro/hubble-fix-reply-filtering branch September 23, 2020 12:43
gandro added a commit that referenced this pull request Oct 26, 2020
This fixes a long-standing issue with Hubble not being able to
distingiush between the reply field being false and the reply field
being absent. To address the issue, the old `reply` field is replaced
with a tri-state `is_reply` field which can be either nil, true or
false. All uses of the old field are removed in the source tree, but the
field itself is preserved for backwards-compatibility.

This incidentally also fixes a bug where the `port-distribution` metric
suffered from the same confusion, which caused it to report source ports
as destination ports.

Ref: #13248
Fixes: #13744

Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
pchaigno pushed a commit that referenced this pull request Oct 27, 2020
This fixes a long-standing issue with Hubble not being able to
distingiush between the reply field being false and the reply field
being absent. To address the issue, the old `reply` field is replaced
with a tri-state `is_reply` field which can be either nil, true or
false. All uses of the old field are removed in the source tree, but the
field itself is preserved for backwards-compatibility.

This incidentally also fixes a bug where the `port-distribution` metric
suffered from the same confusion, which caused it to report source ports
as destination ports.

Ref: #13248
Fixes: #13744

Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
aditighag pushed a commit to aditighag/cilium that referenced this pull request Oct 27, 2020
[ upstream commit 0507c62 ]

This fixes a long-standing issue with Hubble not being able to
distingiush between the reply field being false and the reply field
being absent. To address the issue, the old `reply` field is replaced
with a tri-state `is_reply` field which can be either nil, true or
false. All uses of the old field are removed in the source tree, but the
field itself is preserved for backwards-compatibility.

This incidentally also fixes a bug where the `port-distribution` metric
suffered from the same confusion, which caused it to report source ports
as destination ports.

Ref: cilium#13248
Fixes: cilium#13744

Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
Signed-off-by: Aditi Ghag <aditi@cilium.io>
jrajahalme pushed a commit that referenced this pull request Oct 28, 2020
[ upstream commit 0507c62 ]

This fixes a long-standing issue with Hubble not being able to
distingiush between the reply field being false and the reply field
being absent. To address the issue, the old `reply` field is replaced
with a tri-state `is_reply` field which can be either nil, true or
false. All uses of the old field are removed in the source tree, but the
field itself is preserved for backwards-compatibility.

This incidentally also fixes a bug where the `port-distribution` metric
suffered from the same confusion, which caused it to report source ports
as destination ports.

Ref: #13248
Fixes: #13744

Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
Signed-off-by: Aditi Ghag <aditi@cilium.io>
gandro added a commit that referenced this pull request Nov 3, 2020
[ upstream commit 0507c62 ]

This fixes a long-standing issue with Hubble not being able to
distingiush between the reply field being false and the reply field
being absent. To address the issue, the old `reply` field is replaced
with a tri-state `is_reply` field which can be either nil, true or
false. All uses of the old field are removed in the source tree, but the
field itself is preserved for backwards-compatibility.

This incidentally also fixes a bug where the `port-distribution` metric
suffered from the same confusion, which caused it to report source ports
as destination ports.

Ref: #13248
Fixes: #13744

Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
joestringer pushed a commit that referenced this pull request Nov 3, 2020
[ upstream commit 0507c62 ]

This fixes a long-standing issue with Hubble not being able to
distingiush between the reply field being false and the reply field
being absent. To address the issue, the old `reply` field is replaced
with a tri-state `is_reply` field which can be either nil, true or
false. All uses of the old field are removed in the source tree, but the
field itself is preserved for backwards-compatibility.

This incidentally also fixes a bug where the `port-distribution` metric
suffered from the same confusion, which caused it to report source ports
as destination ports.

Ref: #13248
Fixes: #13744

Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants