diff --git a/northd/en-ls-stateful.c b/northd/en-ls-stateful.c index 1534bad9f6..bf42a25788 100644 --- a/northd/en-ls-stateful.c +++ b/northd/en-ls-stateful.c @@ -138,12 +138,9 @@ ls_stateful_northd_handler(struct engine_node *node, void *data_) return false; } - if (northd_has_lswitchs_in_tracked_data(&northd_data->trk_data)) { - return false; - } - if (!northd_has_ls_lbs_in_tracked_data(&northd_data->trk_data) && - !northd_has_ls_acls_in_tracked_data(&northd_data->trk_data)) { + !northd_has_ls_acls_in_tracked_data(&northd_data->trk_data) && + !northd_has_lswitchs_in_tracked_data(&northd_data->trk_data)) { return true; } @@ -153,6 +150,10 @@ ls_stateful_northd_handler(struct engine_node *node, void *data_) struct hmapx_node *hmapx_node; struct hmapx changed_stateful_od = HMAPX_INITIALIZER(&changed_stateful_od); + HMAPX_FOR_EACH (hmapx_node, &nd_changes->trk_switches.crupdated) { + hmapx_add(&changed_stateful_od, hmapx_node->data); + } + HMAPX_FOR_EACH (hmapx_node, &nd_changes->ls_with_changed_lbs) { hmapx_add(&changed_stateful_od, hmapx_node->data); } @@ -166,9 +167,14 @@ ls_stateful_northd_handler(struct engine_node *node, void *data_) struct ls_stateful_record *ls_stateful_rec = ls_stateful_table_find_( &data->table, od->nbs); - ovs_assert(ls_stateful_rec); - ls_stateful_record_reinit(ls_stateful_rec, od, NULL, + if (!ls_stateful_rec) { + ls_stateful_rec = + ls_stateful_record_create(&data->table, od, + input_data.ls_port_groups); + } else { + ls_stateful_record_reinit(ls_stateful_rec, od, NULL, input_data.ls_port_groups); + } /* Add the ls_stateful_rec to the tracking data. */ hmapx_add(&data->trk_data.crupdated, ls_stateful_rec); diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at index e1dbd8bab9..8912951765 100644 --- a/tests/ovn-northd.at +++ b/tests/ovn-northd.at @@ -14287,7 +14287,7 @@ check ovn-nbctl --wait=sb sync check as northd ovn-appctl -t ovn-northd inc-engine/clear-stats check ovn-nbctl --wait=sb ls-add sw0 check_engine_stats northd norecompute compute -check_engine_stats ls_stateful recompute nocompute +check_engine_stats ls_stateful norecompute compute check_engine_stats lflow recompute nocompute # For the below engine nodes, en_northd is input. So check