Comment 1 for bug 1966052

Revision history for this message
Fernando Royo (froyoredhat) wrote :

I have been doing some tests about this bug and I have come to the following conclusions:

- As you said when the LogicalRouterPortEvent (add interface to N2 to R1) is triggered these actions are taking place for each LB present on the new network (N2) that is not present on the router (R1):

 1 - The unique LBs on the network (N2) are added to the router's (R1) LB field OVN NB DB
 2 - The unique LBs on the network (N2) are added to the Logical_Switch LB field OVN NB DB related to router (R1)
 3 - The external_ids.lr_ref field of the LB been iterated is modified by adding the affected router (R1)
 4 - The unique LBs on the router (R1) are added to the Logical_Switch LB field OVN NB DB related to network (N2)

so taking that into consideration and reading several times your comment, I understand that your proposal it is as follow:

- Step 1, 2 and 4 keeps same
- Step 3 needs to be modified and only modify the lr_ref of the LB if the router (R1) it is the default gateway of network (N2)

Am I right?

Assuming above change, we can see some examples (I hope I manage to explain myself and don't mess up :D)

case a) Different networks (nx, snx and rx created and after that LBx created)

              LB=LB1 LB=LB2
              ┌─────┐ ┌─────┐
              │n1 │ │ n2 │
              └──┬──┘ └──┬──┘
                 │ │
                 │ │
              ┌──┴──┐ ┌──┴──┐
    LB1 ─────►sn1 │ │ sn2 ◄──── LB2
              └──┬──┘ └──┬──┘
 ls_ref=n1 │ │ ls_ref=n2
 lr_ref=r1 │ │ lr_ref=r2
              ┌──┴──┐ ┌──┴──┐
              │r1 │ │ r2 │
              └─────┘ └─────┘
               LB=LB1 LB=LB2

─────────────────────────────────────────────────────────────────────────────
When we add a interface from r1 to n2, this is the final result:

               LB=LB1,LB2 LB=LB2,LB1
               ┌─────┐ ┌─────┐
               │n1 │ │ n2 │
               └──┬──┘ └──┬──┘
                  │ │
                  │ │
               ┌──┴──┐ ┌──┴──┐
     LB1 ─────►sn1 │ ┌────┤ sn2 ◄──── LB2
               └──┬──┘ │ └──┬──┘
  ls_ref=n1 │ │ │ ls_ref=n2
  lr_ref=r1 │ │ │ lr_ref=r2
               ┌──┴──┐ │ ┌──┴──┐
               │r1 ├──────┘ │ r2 │
               └─────┘ └─────┘
                LB=LB1,LB2 LB=LB2

case b) Same network (nx, snx and rx created and after that LBx created)

                    LB=LB1,LB2
              ┌───────────────────┐
              │ n1 │
              └──┬─────────────┬──┘
                 │ │
                 │ │
              ┌──┴──┐ ┌──┴──┐
    LB1 ─────►sn1 │ │ sn2 ◄──── LB2
              └──┬──┘ └──┬──┘
 ls_ref=n1 │ │ ls_ref=n1
 lr_ref=r1 │ │ lr_ref=r2
              ┌──┴──┐ ┌──┴──┐
              │r1 │ │ r2 │
              └─────┘ └─────┘
               LB=LB1 LB=LB2
 ────────────────────────────────────────────────
 When we add a interface from r1 to n2, this is the final result

                      LB=LB1,LB2
                ┌─────────────────────┐
                │ n1 │
                └──┬───────────────┬──┘
                   │ │
                   │ │
                ┌──┴──┐ ┌──┴──┐
      LB1 ─────►sn1 │ ┌──┤ sn2 ◄── LB2
                └──┬──┘ │ └──┬──┘
   ls_ref=n1 │ │ │ ls_ref=n1
   lr_ref=r1 │ │ │ lr_ref=r2
                ┌──┴──┐ │ ┌──┴──┐
                │r1 ├──────┘ │ r2 │
                └─────┘ └─────┘
                 LB=LB1,LB2 LB=LB2

case c) Same network but different steps on topology

                    LB=LB1,LB2
               ┌─────────────────┐
               │ n1 │
               └──┬───────────┬──┘
                  │ │
                  │ │
               ┌──┴──┐ ┌──┴──┐
     LB1 ─────►sn1 │ │ sn2 ◄── LB2
               └─────┘ └──┬──┘
    ls_ref=n1 │ ls_ref=n1
                              │ lr_ref=r2
                           ┌──┴──┐
                           │ r2 │
                           └─────┘
                            LB=LB2
──────────────────────────────────────────────────────────────────────────
We add now the r1 to sn1, it will trigger the LogicalRouterPortEvent

                    LB=LB1,LB2
               ┌──────────────────┐
               │ n1 │
               └──┬────────────┬──┘
                  │ │
                  │ │
               ┌──┴──┐ ┌──┴──┐
     LB1 ─────►sn1 │ │ sn2 ◄── LB2
               └──┬──┘ └──┬──┘
     ls_ref=n1 │ │ ls_ref=n1
     lr_ref=r1 │ │ lr_ref=r2
               ┌──┴──┐ ┌──┴──┐
               │r1 │ │ r2 │
               └─────┘ └─────┘
                LB=LB1,LB2 LB=LB2

As you can see the case b and case c should be finish in the same topology but we need to add the interface from r1 to n2 to get the same.

So maybe I'm missing something or if you can propose any topology or example to understand better your approach.