[ovs-git] [ovn-org/ovn] d41a33: controller: Monitor all logical flows that refer t...

Dumitru Ceara noreply at github.com
Mon Apr 19 16:31:50 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/ovn-org/ovn
  Commit: d41a337fe3b608a8f90de8722d148344011f0bd8
      https://github.com/ovn-org/ovn/commit/d41a337fe3b608a8f90de8722d148344011f0bd8
  Author: Dumitru Ceara <dceara at redhat.com>
  Date:   2021-04-19 (Mon, 19 Apr 2021)

  Changed paths:
    M controller/ovn-controller.c

  Log Message:
  -----------
  controller: Monitor all logical flows that refer to datapath groups.

Considering two logical datapaths (DP1 and DP2) and a logical flow that
is shared between the two, ovn-northd will create the following SB
records:

Datapaths: DP1, DP2
Logical_DP_Group: DPG1 {dps=[DP1, DP2]}
Logical_Flow: LF {dp_group=DPG1}

If an ovn-controller is conditionally monitoring DP1 and DP2 its
monitor conditions look like this:

Logical_DP_Group table when:
 - Logical_DP_Group.datapaths includes [DP1._uuid or DP2._uuid]
Logical_Flow table when:
 - Logical_Flow.logical_datapath in {DP1._uuid, DP2._uuid}
 - Logical_Flow.logical_dp_group in {DPG1._uuid}

If at this point a new logical datapath DP3 is created (e.g., a LS is
added) and the logical flow LF is shared with this third datapath, then
ovn-northd populates the SB with the following contents, replacing
old DPG1 with DPG1-new:

Datapaths: DP1, DP2, DP3
Logical_DP_Group: DPG1-new {dps=[DP1, DP2, DP3]}
Logical_Flow: LF {dp_group=DPG1-new}

At this point, the SB ovsdb-server will send the following updates to
ovn-controller, to match the current monitor condition it requested:

Datapaths:
- "insert" DP3

Logical_DP_Group:
- "delete" DPG1
- "insert" DPG1-new {dps=[DP1, DP2, DP3]}

Logical_Flow:
- "delete" LF

DPG1-new is inserted in the client's view of the database because its
datapaths include DP1 and DP2 which are part of the client's monitor
condition for Logical_DP_Group.  However, the logical flow is deleted
from the client's view of the database because the monitor condition
for Logical_Flow records doesn't include DPG1-new._uuid.

Now ovn-controller will:
- delete all openflows corresponding to LF, including the ones generated
  for datapaths DP1 and DP2.
- compute new set of monitor conditions and send the monitor_cond_change
  request to the SB:

Logical_DP_Group.datapaths includes
        [DP1._uuid or DP2._uuid or DP3._uuid]
Logical_Flow table when:
 - Logical_Flow.logical_datapath in {DP1._uuid, DP2._uuid, DP3._uuid}
 - Logical_Flow.logical_dp_group in {DPG1-new._uuid}

Upon processing this new set of conditions, the SB sends the following
update:
Logical_Flow:
- "insert" LF <--- now LF.logical_dp_group matches the condition.

Finally, ovn-controller will add all openflows that correspond to LF, on
all datapaths, DP1, DP2, DP3.

There is therefore a window in which traffic on DP1 and DP2 might be
dropped because openflows corresponding to LF1 on DP1 and DP2 have been
removed but not yet reinstalled.

To avoid this we now unconditionally monitor all logical flows that
refer to datapath groups.

Fixes: 4b946b366c4c ("controller: Add support for Logical Datapath Groups.")
Reported-at: https://bugzilla.redhat.com/1947056
Suggested-by: Ilya Maximets <i.maximets at ovn.org>
Acked-by: Ilya Maximets <i.maximets at ovn.org>
Signed-off-by: Dumitru Ceara <dceara at redhat.com>
Acked-by: Mark Michelson <mmichels at redhat.com>
Signed-off-by: Numan Siddique <numans at ovn.org>




More information about the git mailing list