Skip to content

Commit

Permalink
northd: Populate additional-chassis to HA group.
Browse files Browse the repository at this point in the history
northd does not populate Port_Binding:additional-chassis to
Ha_Chassis_Group:ref_chassis, so, bfd session is not created
for such chassis.

The fix populates additional chassis to ref chassis.

Signed-off-by: Aleksandr Smirnov <[email protected]>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2024-September/417293.html
Reported-by: Vladislav Odintsov <[email protected]>
Tested-by: Vladislav Odintsov <[email protected]>
Signed-off-by: Numan Siddique <[email protected]>
(cherry picked from commit 3b4af0e)
  • Loading branch information
AlexanderBeta4 authored and numansiddique committed Nov 13, 2024
1 parent 0e2fb83 commit c8c21d9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
12 changes: 10 additions & 2 deletions northd/northd.c
Original file line number Diff line number Diff line change
Expand Up @@ -19096,7 +19096,14 @@ collect_lr_groups_for_ha_chassis_groups(const struct sbrec_port_binding *sb,
}

hmapx_add(lr_groups, lr_group);
hmapx_add(&lr_group->tmp_ha_ref_chassis, sb->chassis);

if (sb->chassis) {
hmapx_add(&lr_group->tmp_ha_ref_chassis, sb->chassis);
}

for (size_t i = 0; i < sb->n_additional_chassis; i++) {
hmapx_add(&lr_group->tmp_ha_ref_chassis, sb->additional_chassis[i]);
}
}

static void
Expand Down Expand Up @@ -19213,7 +19220,8 @@ handle_port_binding_changes(struct ovsdb_idl_txn *ovnsb_txn,
sbrec_port_binding_set_up(op->sb, &up, 1);
}

if (build_ha_chassis_ref && ovnsb_txn && sb->chassis) {
if (build_ha_chassis_ref && ovnsb_txn
&& (sb->chassis || sb->n_additional_chassis)) {
/* Check and collect the chassis which has claimed this 'sb'
* in relation to LR groups. */
collect_lr_groups_for_ha_chassis_groups(sb, op, &lr_groups);
Expand Down
7 changes: 7 additions & 0 deletions tests/ovn-northd.at
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ check ovn-sbctl chassis-add ch2 geneve 127.0.0.3
check ovn-sbctl chassis-add ch3 geneve 127.0.0.4
check ovn-sbctl chassis-add comp1 geneve 127.0.0.5
check ovn-sbctl chassis-add comp2 geneve 127.0.0.6
check ovn-sbctl chassis-add cadd1 geneve 127.0.0.7

check ovn-nbctl lrp-add lr0 lr0-sw0 00:00:20:20:12:14 10.0.0.1/24
check ovn-nbctl lsp-add sw0 sw0-lr0
Expand All @@ -584,11 +585,17 @@ wait_row_count nb:Logical_Switch_Port 1 name=sw0-p1 up=true

comp1_ch_uuid=$(fetch_column Chassis _uuid name=comp1)
comp2_ch_uuid=$(fetch_column Chassis _uuid name=comp2)
cadd1_ch_uuid=$(fetch_column Chassis _uuid name=cadd1)

ch2_ch_uuid=$comp1_ch_uuid

# Check ref_chassis.
echo "comp1_ch_uuid = $comp1_ch_uuid"
wait_column "$comp1_ch_uuid" HA_Chassis_Group ref_chassis
ovn-sbctl set Port_Binding sw0-p1 additional_chassis=$cadd1_ch_uuid
wait_column "$cadd1_ch_uuid $comp1_ch_uuid" HA_Chassis_Group ref_chassis
ovn-sbctl clear Port_Binding sw0-p1 additional_chassis
wait_column "$comp1_ch_uuid" HA_Chassis_Group ref_chassis

# unbind sw0-p1
ovn-sbctl lsp-unbind sw0-p1
Expand Down

0 comments on commit c8c21d9

Please sign in to comment.