-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Prevent incorrect deletion of HostSubnet OVS flows #19080
Prevent incorrect deletion of HostSubnet OVS flows #19080
Conversation
6ba1067
to
8a3fad0
Compare
/lgtm |
pkg/network/node/subnets.go
Outdated
} | ||
} | ||
if err := hsw.networkInfo.ValidateNodeIP(hs.HostIP); err != nil { | ||
return fmt.Errorf("Ignoring invalid subnet for node %s: %v", hs.HostIP, err) |
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.
fmt.Errorf("ignoring...
pkg/network/node/ovscontroller.go
Outdated
otx.DeleteFlows("table=10, tun_src=%s", subnet.HostIP) | ||
otx.DeleteFlows("table=50, arp, nw_dst=%s", subnet.Subnet) | ||
otx.DeleteFlows("table=90, ip, nw_dst=%s", subnet.Subnet) | ||
otx.DeleteFlows("table=10, cookie=0x%08x", cookie) |
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 could use both cookie and ip here
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.
Done. I would add a test, but that would require actually coming up with a partial sha256 collision, and if I'm gonna do that I want to end up with some bitcoins at the end!
8a3fad0
to
ad8877b
Compare
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.
/lgtm
/approve
/test gcp |
/retest |
1 similar comment
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: danwinship, dcbw, pravisankar 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 |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
If this is severe enough please cherry-pick to origin 3.9 once merged. |
/retest Please review the full test history for this PR and help us cut down flakes. |
In certain circumstances we can end up with two HostSubnets having the same HostIP, which will then eventually cause nodes to delete the wrong flows:
This is related to #18617 but it's not the same bug; there the HostSubnet.Subnet field is changing, which would require that the HostSubnet was actually deleted and recreated. (Which means I still don't know what's really going on in #18617.)
Anyway, the fix I went with is to add a cookie based on the HostSubnet.UID to the OVS flows, and then delete based on that rather than on the HostIP/Subnet.
I don't think this problem affects any other OVS flows; pod and service IPs should actually be enforced to be unique, so this wouldn't be able to happen. But maybe we should do UID-based cookies on everything anyway?
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1538220