Skip to content

Commit

Permalink
fix: add a periodically recompute to ovn-controller to avoid inconsis…
Browse files Browse the repository at this point in the history
…tency

ovn 2.12 use a new incremental process engine that increase the performance of ovn-controller. However we meet inconsistency between ovn-sb and ovs several times, so we pick the recompute patch from upstream and periodically invoke it to keep consistent

(cherry picked from commit dc92afa)
  • Loading branch information
oilbeater committed Jan 9, 2020
1 parent 9de9d0b commit 61b7dde
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/images/Dockerfile.cni
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN yum install -y \
yum clean all

ENV OVS_VERSION=2.12.0
ENV OVS_SUBVERSION=3
ENV OVS_SUBVERSION=4

RUN rpm -ivh https://github.com/alauda/ovs/releases/download/${OVS_VERSION}-${OVS_SUBVERSION}/openvswitch-${OVS_VERSION}-${OVS_SUBVERSION}.el7.x86_64.rpm && \
rpm -ivh https://github.com/alauda/ovs/releases/download/${OVS_VERSION}-${OVS_SUBVERSION}/ovn-${OVS_VERSION}-${OVS_SUBVERSION}.el7.x86_64.rpm && \
Expand Down
2 changes: 1 addition & 1 deletion dist/images/Dockerfile.controller
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN yum install -y \
yum clean all

ENV OVS_VERSION=2.12.0
ENV OVS_SUBVERSION=3
ENV OVS_SUBVERSION=4

RUN rpm -ivh https://github.com/alauda/ovs/releases/download/${OVS_VERSION}-${OVS_SUBVERSION}/openvswitch-${OVS_VERSION}-${OVS_SUBVERSION}.el7.x86_64.rpm && \
rpm -ivh https://github.com/alauda/ovs/releases/download/${OVS_VERSION}-${OVS_SUBVERSION}/openvswitch-devel-${OVS_VERSION}-${OVS_SUBVERSION}.el7.x86_64.rpm && \
Expand Down
2 changes: 1 addition & 1 deletion dist/images/Dockerfile.db
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN yum install -y \
yum clean all

ENV OVS_VERSION=2.12.0
ENV OVS_SUBVERSION=3
ENV OVS_SUBVERSION=4

RUN rpm -ivh https://github.com/alauda/ovs/releases/download/${OVS_VERSION}-${OVS_SUBVERSION}/openvswitch-${OVS_VERSION}-${OVS_SUBVERSION}.el7.x86_64.rpm && \
rpm -ivh https://github.com/alauda/ovs/releases/download/${OVS_VERSION}-${OVS_SUBVERSION}/openvswitch-devel-${OVS_VERSION}-${OVS_SUBVERSION}.el7.x86_64.rpm && \
Expand Down
2 changes: 1 addition & 1 deletion dist/images/Dockerfile.node
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN yum install -y \
yum clean all

ENV OVS_VERSION=2.12.0
ENV OVS_SUBVERSION=3
ENV OVS_SUBVERSION=4

RUN rpm -ivh https://github.com/alauda/ovs/releases/download/${OVS_VERSION}-${OVS_SUBVERSION}/openvswitch-${OVS_VERSION}-${OVS_SUBVERSION}.el7.x86_64.rpm && \
rpm -ivh https://github.com/alauda/ovs/releases/download/${OVS_VERSION}-${OVS_SUBVERSION}/openvswitch-devel-${OVS_VERSION}-${OVS_SUBVERSION}.el7.x86_64.rpm && \
Expand Down
2 changes: 1 addition & 1 deletion dist/images/Dockerfile.pinger
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN yum install -y \
yum clean all

ENV OVS_VERSION=2.12.0
ENV OVS_SUBVERSION=3
ENV OVS_SUBVERSION=4

RUN rpm -ivh https://github.com/alauda/ovs/releases/download/${OVS_VERSION}-${OVS_SUBVERSION}/openvswitch-${OVS_VERSION}-${OVS_SUBVERSION}.el7.x86_64.rpm && \
rpm -ivh https://github.com/alauda/ovs/releases/download/${OVS_VERSION}-${OVS_SUBVERSION}/openvswitch-devel-${OVS_VERSION}-${OVS_SUBVERSION}.el7.x86_64.rpm && \
Expand Down
2 changes: 1 addition & 1 deletion dist/images/Dockerfile.webhook
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN yum install -y \
yum clean all

ENV OVS_VERSION=2.12.0
ENV OVS_SUBVERSION=3
ENV OVS_SUBVERSION=4

RUN rpm -ivh https://github.com/alauda/ovs/releases/download/${OVS_VERSION}-${OVS_SUBVERSION}/openvswitch-${OVS_VERSION}-${OVS_SUBVERSION}.el7.x86_64.rpm && \
rpm -ivh https://github.com/alauda/ovs/releases/download/${OVS_VERSION}-${OVS_SUBVERSION}/openvswitch-devel-${OVS_VERSION}-${OVS_SUBVERSION}.el7.x86_64.rpm && \
Expand Down
9 changes: 9 additions & 0 deletions pkg/daemon/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package daemon
import (
"fmt"
"net"
"os/exec"
"time"

"k8s.io/client-go/kubernetes/scheme"
Expand Down Expand Up @@ -348,6 +349,7 @@ func (c *Controller) Run(stopCh <-chan struct{}) error {
return err
}
c.protocol = util.CheckProtocol(node.Annotations[util.IpAddressAnnotation])
go wait.Until(recompute, 10 * time.Minute, stopCh)
go wait.Until(c.runGateway, 3 * time.Second, stopCh)

klog.Info("Started workers")
Expand All @@ -356,3 +358,10 @@ func (c *Controller) Run(stopCh <-chan struct{}) error {

return nil
}

func recompute() {
output, err := exec.Command("ovs-appctl", "-t", "ovn-controller", "recompute").CombinedOutput()
if err != nil {
klog.Errorf("failed to recompute ovn-controller %s", string(output))
}
}

0 comments on commit 61b7dde

Please sign in to comment.