From patchwork Thu Oct 26 18:19:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Numan Siddique X-Patchwork-Id: 1855925 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SGYy14GQ2z23jh for ; Fri, 27 Oct 2023 05:20:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id B15776FB1D; Thu, 26 Oct 2023 18:20:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org B15776FB1D X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6tJNi4gWTV6d; Thu, 26 Oct 2023 18:20:37 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 32A3F6FAF1; Thu, 26 Oct 2023 18:20:36 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 32A3F6FAF1 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 044F1C0032; Thu, 26 Oct 2023 18:20:36 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5E485C0039 for ; Thu, 26 Oct 2023 18:20:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 0D1CE80CC8 for ; Thu, 26 Oct 2023 18:19:49 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 0D1CE80CC8 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SnCGLS6lb7np for ; Thu, 26 Oct 2023 18:19:43 +0000 (UTC) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by smtp1.osuosl.org (Postfix) with ESMTPS id 7862384465 for ; Thu, 26 Oct 2023 18:19:40 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 7862384465 Received: by mail.gandi.net (Postfix) with ESMTPSA id 9360BE0003; Thu, 26 Oct 2023 18:19:37 +0000 (UTC) From: numans@ovn.org To: dev@openvswitch.org Date: Thu, 26 Oct 2023 14:19:13 -0400 Message-ID: <20231026181913.3367416-1-numans@ovn.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231026181224.3366779-1-numans@ovn.org> References: <20231026181224.3366779-1-numans@ovn.org> MIME-Version: 1.0 X-GND-Sasl: numans@ovn.org Subject: [ovs-dev] [PATCH ovn v2 18/18] northd: Add northd change handler for sync_to_sb_lb node. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Numan Siddique Any changes to northd engine node due to load balancers are now handled in 'sync_to_sb_lb' node to sync the changed load balancers to SB load balancers. The logic to sync the SB load balancers is changed a bit and it now mimics the SB lflow sync. Below are the scale testing results done with all the patches applied in this series using ovn-heater. The test ran the scenario - ocp-500-density-heavy.yml [1]. The resuts are: ------------------------------------------------------------------------------------------------------------------------------------------------------- Min (s) Median (s) 90%ile (s) 99%ile (s) Max (s) Mean (s) Total (s) Count Failed ------------------------------------------------------------------------------------------------------------------------------------------------------- Iteration Total 0.136883 1.129016 1.192001 1.204167 1.212728 0.665017 83.127099 125 0 Namespace.add_ports 0.005216 0.005736 0.007034 0.015486 0.018978 0.006211 0.776373 125 0 WorkerNode.bind_port 0.035030 0.046082 0.052469 0.058293 0.060311 0.045973 11.493259 250 0 WorkerNode.ping_port 0.005057 0.006727 1.047692 1.069253 1.071336 0.266896 66.724094 250 0 ------------------------------------------------------------------------------------------------------------------------------------------------------- The results with the present main [2] are: ------------------------------------------------------------------------------------------------------------------------------------------------------- Min (s) Median (s) 90%ile (s) 99%ile (s) Max (s) Mean (s) Total (s) Count Failed ------------------------------------------------------------------------------------------------------------------------------------------------------- Iteration Total 0.135491 2.223805 3.311270 3.339078 3.345346 1.729172 216.146495 125 0 Namespace.add_ports 0.005380 0.005744 0.006819 0.018773 0.020800 0.006292 0.786532 125 0 WorkerNode.bind_port 0.034179 0.046055 0.053488 0.058801 0.071043 0.046117 11.529311 250 0 WorkerNode.ping_port 0.004956 0.006952 3.086952 3.191743 3.192807 0.791544 197.886026 250 0 ------------------------------------------------------------------------------------------------------------------------------------------------------- [1] - https://github.com/ovn-org/ovn-heater/blob/main/test-scenarios/ocp-500-density-heavy.yml [2] - 2a12cda890a7("controller, northd: Wait for cleanup before replying to exit") Signed-off-by: Numan Siddique --- northd/en-sync-sb.c | 447 +++++++++++++++++++++++++++++++++++++-- northd/inc-proc-northd.c | 1 + northd/lflow-mgr.c | 196 ++++++----------- northd/lflow-mgr.h | 23 +- northd/northd.c | 238 --------------------- northd/northd.h | 6 - tests/ovn-northd.at | 102 +++++---- 7 files changed, 586 insertions(+), 427 deletions(-) diff --git a/northd/en-sync-sb.c b/northd/en-sync-sb.c index 7a5d2f0ccd..1cb4a58718 100644 --- a/northd/en-sync-sb.c +++ b/northd/en-sync-sb.c @@ -30,6 +30,7 @@ #include "lib/ovn-nb-idl.h" #include "lib/ovn-sb-idl.h" #include "lib/ovn-util.h" +#include "lflow-mgr.h" #include "northd.h" #include "openvswitch/vlog.h" @@ -53,6 +54,38 @@ static void build_port_group_address_set(const struct nbrec_port_group *, struct svec *ipv4_addrs, struct svec *ipv6_addrs); +struct sb_lb_table; +struct sb_lb_record; +static void sb_lb_table_init(struct sb_lb_table *); +static void sb_lb_table_clear(struct sb_lb_table *); +static struct sb_lb_record *sb_lb_table_find(struct hmap *sb_lbs, + const struct uuid *); +static void sb_lb_table_build_and_sync(struct sb_lb_table *, + struct ovsdb_idl_txn *ovnsb_txn, + const struct sbrec_load_balancer_table *, + const struct sbrec_logical_dp_group_table *, + struct hmap *lb_dps_map, + struct ovn_datapaths *ls_datapaths, + struct ovn_datapaths *lr_datapaths, + struct chassis_features *); +static void sync_sb_lb_record(struct sb_lb_record *, + const struct sbrec_load_balancer *, + const struct sbrec_logical_dp_group_table *, + struct sb_lb_table *, + struct ovsdb_idl_txn *ovnsb_txn, + struct ovn_datapaths *ls_datapaths, + struct ovn_datapaths *lr_datapaths, + struct chassis_features *); +static void sync_changed_lbs(struct sb_lb_table *, + struct ovsdb_idl_txn *ovnsb_txn, + const struct sbrec_load_balancer_table *, + const struct sbrec_logical_dp_group_table *, + struct tracked_lbs *, + struct ovn_datapaths *ls_datapaths, + struct ovn_datapaths *lr_datapaths, + struct chassis_features *); +static bool check_sb_lb_duplicates(const struct sbrec_load_balancer_table *); + void * en_sync_to_sb_init(struct engine_node *node OVS_UNUSED, struct engine_arg *arg OVS_UNUSED) @@ -211,51 +244,103 @@ sync_to_sb_addr_set_nb_port_group_handler(struct engine_node *node, /* sync_to_sb_lb engine node functions. * This engine node syncs the SB load balancers. */ +struct sb_lb_record { + struct hmap_node key_node; /* Index on 'nblb->header_.uuid'. */ + + struct ovn_lb_datapaths *lb_dps; + const struct sbrec_load_balancer *sbrec_lb; + struct ovn_dp_group *ls_dpg; + struct ovn_dp_group *lr_dpg; + struct uuid sb_uuid; +}; + +struct sb_lb_table { + struct hmap entries; /* Stores struct sb_lb_record. */ + struct hmap ls_dp_groups; + struct hmap lr_dp_groups; +}; + +struct ed_type_sync_to_sb_lb_data { + struct sb_lb_table sb_lbs; +}; + void * en_sync_to_sb_lb_init(struct engine_node *node OVS_UNUSED, struct engine_arg *arg OVS_UNUSED) { - return NULL; + struct ed_type_sync_to_sb_lb_data *data = xzalloc(sizeof *data); + sb_lb_table_init(&data->sb_lbs); + + return data; } void -en_sync_to_sb_lb_run(struct engine_node *node, void *data OVS_UNUSED) +en_sync_to_sb_lb_run(struct engine_node *node, void *data_) { + struct northd_data *northd_data = engine_get_input_data("northd", node); const struct sbrec_load_balancer_table *sb_load_balancer_table = EN_OVSDB_GET(engine_get_input("SB_load_balancer", node)); + const struct sbrec_logical_dp_group_table *sb_dpgrp_table = + EN_OVSDB_GET(engine_get_input("SB_logical_dp_group", node)); struct ed_type_global_config *global_config = engine_get_input_data("global_config", node); + const struct engine_context *eng_ctx = engine_get_context(); - struct northd_data *northd_data = engine_get_input_data("northd", node); + struct ed_type_sync_to_sb_lb_data *data = data_; + + sb_lb_table_clear(&data->sb_lbs); + sb_lb_table_init(&data->sb_lbs); + sb_lb_table_build_and_sync(&data->sb_lbs, eng_ctx->ovnsb_idl_txn, + sb_load_balancer_table, + sb_dpgrp_table, + &northd_data->lb_datapaths_map, + &northd_data->ls_datapaths, + &northd_data->lr_datapaths, + &global_config->features); - sync_lbs(eng_ctx->ovnsb_idl_txn, sb_load_balancer_table, - &northd_data->ls_datapaths, &northd_data->lr_datapaths, - &northd_data->lb_datapaths_map, &global_config->features); engine_set_node_state(node, EN_UPDATED); } void -en_sync_to_sb_lb_cleanup(void *data OVS_UNUSED) +en_sync_to_sb_lb_cleanup(void *data_) { - + struct ed_type_sync_to_sb_lb_data *data = data_; + sb_lb_table_clear(&data->sb_lbs); } bool -sync_to_sb_lb_northd_handler(struct engine_node *node, void *data OVS_UNUSED) +sync_to_sb_lb_northd_handler(struct engine_node *node, void *data_) { struct northd_data *nd = engine_get_input_data("northd", node); - if (!nd->change_tracked || - northd_has_lbs_in_tracked_data(&nd->trk_northd_changes)) { - /* Return false if no tracking data or if lbs changed. */ + if (!nd->change_tracked) { + /* Return false if no tracking data. */ + return false; + } + + if (!northd_has_lbs_in_tracked_data(&nd->trk_northd_changes)) { + return true; + } + + const struct engine_context *eng_ctx = engine_get_context(); + if (!eng_ctx->ovnsb_idl_txn) { return false; } + const struct sbrec_logical_dp_group_table *sb_dpgrp_table = + EN_OVSDB_GET(engine_get_input("SB_logical_dp_group", node)); + const struct sbrec_load_balancer_table *sb_lb_table = + EN_OVSDB_GET(engine_get_input("SB_load_balancer", node)); + struct ed_type_global_config *global_config = + engine_get_input_data("global_config", node); + struct ed_type_sync_to_sb_lb_data *data = data_; + + sync_changed_lbs(&data->sb_lbs, eng_ctx->ovnsb_idl_txn, sb_lb_table, + sb_dpgrp_table, &nd->trk_northd_changes.trk_lbs, + &nd->ls_datapaths, &nd->lr_datapaths, + &global_config->features); - /* There are only NB LSP related changes and these can be safely - * ignore and returned true. However in case the northd engine - * tracking data includes other changes, we need to do additional - * checks before safely ignoring. */ + engine_set_node_state(node, EN_UPDATED); return true; } @@ -530,3 +615,333 @@ sb_address_set_lookup_by_name(struct ovsdb_idl_index *sbrec_addr_set_by_name, return retval; } + +/* static functions related to sync_to_sb_lb */ + +static void +sb_lb_table_init(struct sb_lb_table *sb_lbs) +{ + hmap_init(&sb_lbs->entries); + ovn_dp_groups_init(&sb_lbs->ls_dp_groups); + ovn_dp_groups_init(&sb_lbs->lr_dp_groups); +} + +static void +sb_lb_table_clear(struct sb_lb_table *sb_lbs) +{ + struct sb_lb_record *sb_lb; + HMAP_FOR_EACH_POP (sb_lb, key_node, &sb_lbs->entries) { + free(sb_lb); + } + hmap_destroy(&sb_lbs->entries); + + ovn_dp_groups_destroy(&sb_lbs->ls_dp_groups); + ovn_dp_groups_destroy(&sb_lbs->lr_dp_groups); +} + +static struct sb_lb_record * +sb_lb_table_find(struct hmap *sb_lbs, const struct uuid *lb_uuid) +{ + struct sb_lb_record *sb_lb; + HMAP_FOR_EACH_WITH_HASH (sb_lb, key_node, uuid_hash(lb_uuid), + sb_lbs) { + if (uuid_equals(&sb_lb->lb_dps->lb->nlb->header_.uuid, lb_uuid)) { + return sb_lb; + } + } + + return NULL; +} + +static void +sb_lb_table_build_and_sync(struct sb_lb_table *sb_lbs, + struct ovsdb_idl_txn *ovnsb_txn, + const struct sbrec_load_balancer_table *sb_lb_table, + const struct sbrec_logical_dp_group_table *sb_dpgrp_table, + struct hmap *lb_dps_map, + struct ovn_datapaths *ls_datapaths, + struct ovn_datapaths *lr_datapaths, + struct chassis_features *chassis_features) +{ + struct hmap tmp_sb_lbs = HMAP_INITIALIZER(&tmp_sb_lbs); + struct ovn_lb_datapaths *lb_dps; + struct sb_lb_record *sb_lb; + + HMAP_FOR_EACH (lb_dps, hmap_node, lb_dps_map) { + if (!lb_dps->n_nb_ls && !lb_dps->n_nb_lr) { + continue; + } + + sb_lb = xzalloc(sizeof *sb_lb); + sb_lb->lb_dps = lb_dps; + hmap_insert(&tmp_sb_lbs, &sb_lb->key_node, + uuid_hash(&lb_dps->lb->nlb->header_.uuid)); + } + + const struct sbrec_load_balancer *sbrec_lb; + SBREC_LOAD_BALANCER_TABLE_FOR_EACH_SAFE (sbrec_lb, + sb_lb_table) { + const char *nb_lb_uuid = smap_get(&sbrec_lb->external_ids, "lb_id"); + struct uuid lb_uuid; + if (!nb_lb_uuid || !uuid_from_string(&lb_uuid, nb_lb_uuid)) { + sbrec_load_balancer_delete(sbrec_lb); + continue; + } + + sb_lb = sb_lb_table_find(&tmp_sb_lbs, &lb_uuid); + if (sb_lb) { + sb_lb->sbrec_lb = sbrec_lb; + sync_sb_lb_record(sb_lb, sbrec_lb, sb_dpgrp_table, sb_lbs, + ovnsb_txn, ls_datapaths, lr_datapaths, + chassis_features); + + hmap_remove(&tmp_sb_lbs, &sb_lb->key_node); + hmap_insert(&sb_lbs->entries, &sb_lb->key_node, + uuid_hash(&sb_lb->lb_dps->lb->nlb->header_.uuid)); + } else { + sbrec_load_balancer_delete(sbrec_lb); + } + } + + HMAP_FOR_EACH_POP (sb_lb, key_node, &tmp_sb_lbs) { + sync_sb_lb_record(sb_lb, NULL, sb_dpgrp_table, sb_lbs, + ovnsb_txn, ls_datapaths, lr_datapaths, + chassis_features); + hmap_insert(&sb_lbs->entries, &sb_lb->key_node, + uuid_hash(&sb_lb->lb_dps->lb->nlb->header_.uuid)); + } + + hmap_destroy(&tmp_sb_lbs); +} + +static void +sync_sb_lb_record(struct sb_lb_record *sb_lb, + const struct sbrec_load_balancer *sbrec_lb, + const struct sbrec_logical_dp_group_table *sb_dpgrp_table, + struct sb_lb_table *sb_lbs, + struct ovsdb_idl_txn *ovnsb_txn, + struct ovn_datapaths *ls_datapaths, + struct ovn_datapaths *lr_datapaths, + struct chassis_features *chassis_features) +{ + struct sbrec_logical_dp_group *sbrec_ls_dp_group = NULL; + struct sbrec_logical_dp_group *sbrec_lr_dp_group = NULL; + const struct ovn_lb_datapaths *lb_dps; + struct ovn_dp_group *pre_sync_ls_dpg; + struct ovn_dp_group *pre_sync_lr_dpg; + + lb_dps = sb_lb->lb_dps; + pre_sync_ls_dpg = sb_lb->ls_dpg; + pre_sync_lr_dpg = sb_lb->lr_dpg; + + if (!sbrec_lb) { + sb_lb->sb_uuid = uuid_random(); + sbrec_lb = sbrec_load_balancer_insert_persist_uuid(ovnsb_txn, + &sb_lb->sb_uuid); + char *lb_id = xasprintf( + UUID_FMT, UUID_ARGS(&lb_dps->lb->nlb->header_.uuid)); + const struct smap external_ids = + SMAP_CONST1(&external_ids, "lb_id", lb_id); + sbrec_load_balancer_set_external_ids(sbrec_lb, &external_ids); + free(lb_id); + } else { + sb_lb->sb_uuid = sbrec_lb->header_.uuid; + sbrec_ls_dp_group = + chassis_features->ls_dpg_column + ? sbrec_lb->ls_datapath_group + : sbrec_lb->datapath_group; /* deprecated */ + + sbrec_lr_dp_group = sbrec_lb->lr_datapath_group; + } + + if (lb_dps->n_nb_ls) { + sb_lb->ls_dpg = ovn_dp_group_get(&sb_lbs->ls_dp_groups, + lb_dps->n_nb_ls, + lb_dps->nb_ls_map, + ods_size(ls_datapaths)); + if (sb_lb->ls_dpg) { + /* Update the dpg's sb dp_group. */ + sb_lb->ls_dpg->dp_group = + sbrec_logical_dp_group_table_get_for_uuid(sb_dpgrp_table, + &sb_lb->ls_dpg->dpg_uuid); + ovs_assert(sb_lb->ls_dpg->dp_group); + } else { + sb_lb->ls_dpg = ovn_dp_group_create( + ovnsb_txn, &sb_lbs->ls_dp_groups, + sbrec_ls_dp_group, + lb_dps->n_nb_ls, lb_dps->nb_ls_map, + ods_size(ls_datapaths), true, + ls_datapaths, + lr_datapaths); + } + + if (chassis_features->ls_dpg_column) { + sbrec_load_balancer_set_ls_datapath_group(sbrec_lb, + sb_lb->ls_dpg->dp_group); + sbrec_load_balancer_set_datapath_group(sbrec_lb, NULL); + } else { + /* datapath_group column is deprecated. */ + sbrec_load_balancer_set_ls_datapath_group(sbrec_lb, NULL); + sbrec_load_balancer_set_datapath_group(sbrec_lb, + sb_lb->ls_dpg->dp_group); + + } + } else { + sbrec_load_balancer_set_ls_datapath_group(sbrec_lb, NULL); + sbrec_load_balancer_set_datapath_group(sbrec_lb, NULL); + } + + + if (lb_dps->n_nb_lr) { + sb_lb->lr_dpg = ovn_dp_group_get(&sb_lbs->lr_dp_groups, + lb_dps->n_nb_lr, + lb_dps->nb_lr_map, + ods_size(lr_datapaths)); + if (sb_lb->lr_dpg) { + /* Update the dpg's sb dp_group. */ + sb_lb->lr_dpg->dp_group = + sbrec_logical_dp_group_table_get_for_uuid(sb_dpgrp_table, + &sb_lb->lr_dpg->dpg_uuid); + ovs_assert(sb_lb->lr_dpg->dp_group); + } else { + sb_lb->lr_dpg = ovn_dp_group_create( + ovnsb_txn, &sb_lbs->lr_dp_groups, + sbrec_lr_dp_group, + lb_dps->n_nb_lr, lb_dps->nb_lr_map, + ods_size(lr_datapaths), false, + ls_datapaths, + lr_datapaths); + } + + sbrec_load_balancer_set_lr_datapath_group(sbrec_lb, + sb_lb->lr_dpg->dp_group); + } else { + sbrec_load_balancer_set_lr_datapath_group(sbrec_lb, NULL); + } + + if (pre_sync_ls_dpg != sb_lb->ls_dpg) { + if (sb_lb->ls_dpg) { + inc_ovn_dp_group_ref(sb_lb->ls_dpg); + } + if (pre_sync_ls_dpg) { + dec_ovn_dp_group_ref(&sb_lbs->ls_dp_groups, pre_sync_ls_dpg); + } + } + + if (pre_sync_lr_dpg != sb_lb->lr_dpg) { + if (sb_lb->lr_dpg) { + inc_ovn_dp_group_ref(sb_lb->lr_dpg); + } + if (pre_sync_lr_dpg) { + dec_ovn_dp_group_ref(&sb_lbs->lr_dp_groups, pre_sync_lr_dpg); + } + } + + /* Update columns. */ + sbrec_load_balancer_set_name(sbrec_lb, lb_dps->lb->nlb->name); + sbrec_load_balancer_set_vips(sbrec_lb, + ovn_northd_lb_get_vips(lb_dps->lb)); + sbrec_load_balancer_set_protocol(sbrec_lb, lb_dps->lb->nlb->protocol); + + /* Store the fact that northd provides the original (destination IP + + * transport port) tuple. + */ + struct smap options; + smap_clone(&options, &lb_dps->lb->nlb->options); + smap_replace(&options, "hairpin_orig_tuple", "true"); + sbrec_load_balancer_set_options(sbrec_lb, &options); + /* Clearing 'datapaths' column, since 'dp_group' is in use. */ + sbrec_load_balancer_set_datapaths(sbrec_lb, NULL, 0); + smap_destroy(&options); +} + +static void +sync_changed_lbs(struct sb_lb_table *sb_lbs, + struct ovsdb_idl_txn *ovnsb_txn, + const struct sbrec_load_balancer_table *sb_lb_table, + const struct sbrec_logical_dp_group_table *sb_dpgrp_table, + struct tracked_lbs *trk_lbs, + struct ovn_datapaths *ls_datapaths, + struct ovn_datapaths *lr_datapaths, + struct chassis_features *chassis_features) +{ + struct ovn_lb_datapaths *lb_dps; + struct hmapx_node *hmapx_node; + struct sb_lb_record *sb_lb; + + HMAPX_FOR_EACH (hmapx_node, &trk_lbs->deleted) { + lb_dps = hmapx_node->data; + + sb_lb = sb_lb_table_find(&sb_lbs->entries, + &lb_dps->lb->nlb->header_.uuid); + if (sb_lb) { + const struct sbrec_load_balancer *sbrec_lb = + sbrec_load_balancer_table_get_for_uuid(sb_lb_table, + &sb_lb->sb_uuid); + if (sbrec_lb) { + sbrec_load_balancer_delete(sbrec_lb); + } + + hmap_remove(&sb_lbs->entries, &sb_lb->key_node); + free(sb_lb); + } + } + + HMAPX_FOR_EACH (hmapx_node, &trk_lbs->crupdated) { + lb_dps = hmapx_node->data; + + sb_lb = sb_lb_table_find(&sb_lbs->entries, + &lb_dps->lb->nlb->header_.uuid); + + if (!sb_lb && !lb_dps->n_nb_ls && !lb_dps->n_nb_lr) { + continue; + } + + if (!sb_lb) { + sb_lb = xzalloc(sizeof *sb_lb); + sb_lb->lb_dps = lb_dps; + hmap_insert(&sb_lbs->entries, &sb_lb->key_node, + uuid_hash(&lb_dps->lb->nlb->header_.uuid)); + } else { + sb_lb->sbrec_lb = + sbrec_load_balancer_table_get_for_uuid(sb_lb_table, + &sb_lb->sb_uuid); + } + + if (sb_lb && !lb_dps->n_nb_ls && !lb_dps->n_nb_lr) { + const struct sbrec_load_balancer *sbrec_lb = + sbrec_load_balancer_table_get_for_uuid(sb_lb_table, + &sb_lb->sb_uuid); + if (sbrec_lb) { + sbrec_load_balancer_delete(sbrec_lb); + } + + hmap_remove(&sb_lbs->entries, &sb_lb->key_node); + free(sb_lb); + } + + sync_sb_lb_record(sb_lb, sb_lb->sbrec_lb, sb_dpgrp_table, sb_lbs, + ovnsb_txn, ls_datapaths, lr_datapaths, + chassis_features); + } +} + +static bool +check_sb_lb_duplicates(const struct sbrec_load_balancer_table *table) +{ + struct sset existing_nb_lb_uuids = + SSET_INITIALIZER(&existing_nb_lb_uuids); + const struct sbrec_load_balancer *sbrec_lb; + bool duplicates = false; + + SBREC_LOAD_BALANCER_TABLE_FOR_EACH (sbrec_lb, table) { + const char *nb_lb_uuid = smap_get(&sbrec_lb->external_ids, "lb_id"); + if (nb_lb_uuid && !sset_add(&existing_nb_lb_uuids, nb_lb_uuid)) { + duplicates = true; + break; + } + } + + sset_destroy(&existing_nb_lb_uuids); + return duplicates; +} diff --git a/northd/inc-proc-northd.c b/northd/inc-proc-northd.c index cdc4927deb..6dcbf11d62 100644 --- a/northd/inc-proc-northd.c +++ b/northd/inc-proc-northd.c @@ -285,6 +285,7 @@ void inc_proc_northd_init(struct ovsdb_idl_loop *nb, sync_to_sb_lb_northd_handler); engine_add_input(&en_sync_to_sb_lb, &en_sb_load_balancer, sync_to_sb_lb_sb_load_balancer); + engine_add_input(&en_sync_to_sb_lb, &en_sb_logical_dp_group, NULL); engine_add_input(&en_sync_to_sb_pb, &en_northd, sync_to_sb_pb_northd_handler); diff --git a/northd/lflow-mgr.c b/northd/lflow-mgr.c index d779e7e087..6f0e9ae9cb 100644 --- a/northd/lflow-mgr.c +++ b/northd/lflow-mgr.c @@ -72,21 +72,6 @@ static struct ovs_mutex *lflow_hash_lock(const struct hmap *lflow_table, uint32_t hash); static void lflow_hash_unlock(struct ovs_mutex *hash_lock); -static struct ovn_dp_group *ovn_dp_group_get( - struct hmap *dp_groups, size_t desired_n, - const unsigned long *desired_bitmap, - size_t bitmap_len); -static struct ovn_dp_group *ovn_dp_group_create( - struct ovsdb_idl_txn *ovnsb_txn, struct hmap *dp_groups, - struct sbrec_logical_dp_group *, size_t desired_n, - const unsigned long *desired_bitmap, - size_t bitmap_len, bool is_switch, - const struct ovn_datapaths *ls_datapaths, - const struct ovn_datapaths *lr_datapaths); -static struct ovn_dp_group *ovn_dp_group_get( - struct hmap *dp_groups, size_t desired_n, - const unsigned long *desired_bitmap, - size_t bitmap_len); static struct sbrec_logical_dp_group *ovn_sb_insert_or_update_logical_dp_group( struct ovsdb_idl_txn *ovnsb_txn, struct sbrec_logical_dp_group *, @@ -501,31 +486,81 @@ lflow_table_add_lflow_default_drop(struct lflow_table *lflow_table, where, lflow_ref); } -/* Given a desired bitmap, finds a datapath group in 'dp_groups'. If it - * doesn't exist, creates a new one and adds it to 'dp_groups'. +struct ovn_dp_group * +ovn_dp_group_get(struct hmap *dp_groups, size_t desired_n, + const unsigned long *desired_bitmap, + size_t bitmap_len) +{ + uint32_t hash; + + hash = hash_int(desired_n, 0); + return ovn_dp_group_find(dp_groups, desired_bitmap, bitmap_len, hash); +} + +/* Creates a new datapath group and adds it to 'dp_groups'. * If 'sb_group' is provided, function will try to re-use this group by - * either taking it directly, or by modifying, if it's not already in use. */ + * either taking it directly, or by modifying, if it's not already in use. + * Caller should first call ovn_dp_group_get() before calling this function. */ struct ovn_dp_group * -ovn_dp_group_get_or_create(struct ovsdb_idl_txn *ovnsb_txn, - struct hmap *dp_groups, - struct sbrec_logical_dp_group *sb_group, - size_t desired_n, - const unsigned long *desired_bitmap, - size_t bitmap_len, - bool is_switch, - const struct ovn_datapaths *ls_datapaths, - const struct ovn_datapaths *lr_datapaths) +ovn_dp_group_create(struct ovsdb_idl_txn *ovnsb_txn, + struct hmap *dp_groups, + struct sbrec_logical_dp_group *sb_group, + size_t desired_n, + const unsigned long *desired_bitmap, + size_t bitmap_len, + bool is_switch, + const struct ovn_datapaths *ls_datapaths, + const struct ovn_datapaths *lr_datapaths) { struct ovn_dp_group *dpg; - dpg = ovn_dp_group_get(dp_groups, desired_n, desired_bitmap, bitmap_len); - if (dpg) { - return dpg; + bool update_dp_group = false, can_modify = false; + unsigned long *dpg_bitmap; + size_t i, n = 0; + + dpg_bitmap = sb_group ? bitmap_allocate(bitmap_len) : NULL; + for (i = 0; sb_group && i < sb_group->n_datapaths; i++) { + struct ovn_datapath *datapath_od; + + datapath_od = ovn_datapath_from_sbrec( + ls_datapaths ? &ls_datapaths->datapaths : NULL, + lr_datapaths ? &lr_datapaths->datapaths : NULL, + sb_group->datapaths[i]); + if (!datapath_od || ovn_datapath_is_stale(datapath_od)) { + break; + } + bitmap_set1(dpg_bitmap, datapath_od->index); + n++; + } + if (!sb_group || i != sb_group->n_datapaths) { + /* No group or stale group. Not going to be used. */ + update_dp_group = true; + can_modify = true; + } else if (!bitmap_equal(dpg_bitmap, desired_bitmap, bitmap_len)) { + /* The group in Sb is different. */ + update_dp_group = true; + /* We can modify existing group if it's not already in use. */ + can_modify = !ovn_dp_group_find(dp_groups, dpg_bitmap, + bitmap_len, hash_int(n, 0)); + } + + bitmap_free(dpg_bitmap); + + dpg = xzalloc(sizeof *dpg); + dpg->bitmap = bitmap_clone(desired_bitmap, bitmap_len); + if (!update_dp_group) { + dpg->dp_group = sb_group; + } else { + dpg->dp_group = ovn_sb_insert_or_update_logical_dp_group( + ovnsb_txn, + can_modify ? sb_group : NULL, + desired_bitmap, + is_switch ? ls_datapaths : lr_datapaths); } + dpg->dpg_uuid = dpg->dp_group->header_.uuid; + hmap_insert(dp_groups, &dpg->node, hash_int(desired_n, 0)); - return ovn_dp_group_create(ovnsb_txn, dp_groups, sb_group, desired_n, - desired_bitmap, bitmap_len, is_switch, - ls_datapaths, lr_datapaths); + return dpg; } void @@ -908,24 +943,6 @@ ovn_dp_group_find(const struct hmap *dp_groups, return NULL; } -static void -inc_ovn_dp_group_ref(struct ovn_dp_group *dpg) -{ - dpg->refcnt++; -} - -static void -dec_ovn_dp_group_ref(struct hmap *dp_groups, struct ovn_dp_group *dpg) -{ - dpg->refcnt--; - - if (!dpg->refcnt) { - hmap_remove(dp_groups, &dpg->node); - free(dpg->bitmap); - free(dpg); - } -} - static struct sbrec_logical_dp_group * ovn_sb_insert_or_update_logical_dp_group( struct ovsdb_idl_txn *ovnsb_txn, @@ -952,83 +969,6 @@ ovn_sb_insert_or_update_logical_dp_group( return dp_group; } -static struct ovn_dp_group * -ovn_dp_group_get(struct hmap *dp_groups, size_t desired_n, - const unsigned long *desired_bitmap, - size_t bitmap_len) -{ - uint32_t hash; - - hash = hash_int(desired_n, 0); - return ovn_dp_group_find(dp_groups, desired_bitmap, bitmap_len, hash); -} - -/* Creates a new datapath group and adds it to 'dp_groups'. - * If 'sb_group' is provided, function will try to re-use this group by - * either taking it directly, or by modifying, if it's not already in use. - * Caller should first call ovn_dp_group_get() before calling this function. */ -static struct ovn_dp_group * -ovn_dp_group_create(struct ovsdb_idl_txn *ovnsb_txn, - struct hmap *dp_groups, - struct sbrec_logical_dp_group *sb_group, - size_t desired_n, - const unsigned long *desired_bitmap, - size_t bitmap_len, - bool is_switch, - const struct ovn_datapaths *ls_datapaths, - const struct ovn_datapaths *lr_datapaths) -{ - struct ovn_dp_group *dpg; - - bool update_dp_group = false, can_modify = false; - unsigned long *dpg_bitmap; - size_t i, n = 0; - - dpg_bitmap = sb_group ? bitmap_allocate(bitmap_len) : NULL; - for (i = 0; sb_group && i < sb_group->n_datapaths; i++) { - struct ovn_datapath *datapath_od; - - datapath_od = ovn_datapath_from_sbrec( - ls_datapaths ? &ls_datapaths->datapaths : NULL, - lr_datapaths ? &lr_datapaths->datapaths : NULL, - sb_group->datapaths[i]); - if (!datapath_od || ovn_datapath_is_stale(datapath_od)) { - break; - } - bitmap_set1(dpg_bitmap, datapath_od->index); - n++; - } - if (!sb_group || i != sb_group->n_datapaths) { - /* No group or stale group. Not going to be used. */ - update_dp_group = true; - can_modify = true; - } else if (!bitmap_equal(dpg_bitmap, desired_bitmap, bitmap_len)) { - /* The group in Sb is different. */ - update_dp_group = true; - /* We can modify existing group if it's not already in use. */ - can_modify = !ovn_dp_group_find(dp_groups, dpg_bitmap, - bitmap_len, hash_int(n, 0)); - } - - bitmap_free(dpg_bitmap); - - dpg = xzalloc(sizeof *dpg); - dpg->bitmap = bitmap_clone(desired_bitmap, bitmap_len); - if (!update_dp_group) { - dpg->dp_group = sb_group; - } else { - dpg->dp_group = ovn_sb_insert_or_update_logical_dp_group( - ovnsb_txn, - can_modify ? sb_group : NULL, - desired_bitmap, - is_switch ? ls_datapaths : lr_datapaths); - } - dpg->dpg_uuid = dpg->dp_group->header_.uuid; - hmap_insert(dp_groups, &dpg->node, hash_int(desired_n, 0)); - - return dpg; -} - /* Adds an OVN datapath to a datapath group of existing logical flow. * Version to use when hash bucket locking is NOT required or the corresponding * hash lock is already taken. */ diff --git a/northd/lflow-mgr.h b/northd/lflow-mgr.h index c65cd70e71..583afa6cb3 100644 --- a/northd/lflow-mgr.h +++ b/northd/lflow-mgr.h @@ -160,7 +160,10 @@ ovn_dp_groups_init(struct hmap *dp_groups) } void ovn_dp_groups_destroy(struct hmap *dp_groups); -struct ovn_dp_group *ovn_dp_group_get_or_create( +struct ovn_dp_group *ovn_dp_group_get(struct hmap *dp_groups, size_t desired_n, + const unsigned long *desired_bitmap, + size_t bitmap_len); +struct ovn_dp_group *ovn_dp_group_create( struct ovsdb_idl_txn *ovnsb_txn, struct hmap *dp_groups, struct sbrec_logical_dp_group *sb_group, size_t desired_n, const unsigned long *desired_bitmap, @@ -168,4 +171,22 @@ struct ovn_dp_group *ovn_dp_group_get_or_create( const struct ovn_datapaths *ls_datapaths, const struct ovn_datapaths *lr_datapaths); +static inline void +inc_ovn_dp_group_ref(struct ovn_dp_group *dpg) +{ + dpg->refcnt++; +} + +static inline void +dec_ovn_dp_group_ref(struct hmap *dp_groups, struct ovn_dp_group *dpg) +{ + dpg->refcnt--; + + if (!dpg->refcnt) { + hmap_remove(dp_groups, &dpg->node); + free(dpg->bitmap); + free(dpg); + } +} + #endif /* LFLOW_MGR_H */ \ No newline at end of file diff --git a/northd/northd.c b/northd/northd.c index 0bf987ad94..926b3bfa93 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -3786,244 +3786,6 @@ build_lb_port_related_data( build_lswitch_lbs_from_lrouter(lr_datapaths, lb_dps_map, lb_group_dps_map); } -struct sb_lb { - struct hmap_node hmap_node; - - const struct sbrec_load_balancer *slb; - struct ovn_dp_group *dpg; - struct ovn_dp_group *lr_dpg; - struct uuid lb_uuid; -}; - -static struct sb_lb * -find_slb_in_sb_lbs(struct hmap *sb_lbs, const struct uuid *lb_uuid) -{ - struct sb_lb *sb_lb; - HMAP_FOR_EACH_WITH_HASH (sb_lb, hmap_node, uuid_hash(lb_uuid), sb_lbs) { - if (uuid_equals(&sb_lb->lb_uuid, lb_uuid)) { - return sb_lb; - } - } - - return NULL; -} - -/* Syncs relevant load balancers (applied to logical switches) to the - * Southbound database. - */ -void -sync_lbs(struct ovsdb_idl_txn *ovnsb_txn, - const struct sbrec_load_balancer_table *sbrec_load_balancer_table, - struct ovn_datapaths *ls_datapaths, - struct ovn_datapaths *lr_datapaths, - struct hmap *lb_dps_map, - struct chassis_features *chassis_features) -{ - struct hmap ls_dp_groups = HMAP_INITIALIZER(&ls_dp_groups); - struct hmap lr_dp_groups = HMAP_INITIALIZER(&lr_dp_groups); - struct ovn_lb_datapaths *lb_dps; - struct hmap sb_lbs = HMAP_INITIALIZER(&sb_lbs); - - /* Delete any stale SB load balancer rows and create datapath - * groups for existing ones. */ - struct hmapx existing_lbs = HMAPX_INITIALIZER(&existing_lbs); - const struct sbrec_load_balancer *sbrec_lb; - SBREC_LOAD_BALANCER_TABLE_FOR_EACH_SAFE (sbrec_lb, - sbrec_load_balancer_table) { - const char *nb_lb_uuid = smap_get(&sbrec_lb->external_ids, "lb_id"); - struct uuid lb_uuid; - if (!nb_lb_uuid || !uuid_from_string(&lb_uuid, nb_lb_uuid)) { - sbrec_load_balancer_delete(sbrec_lb); - continue; - } - - /* Delete any SB load balancer entries that refer to NB load balancers - * that don't exist anymore or are not applied to switches/routers - * anymore. - * - * There is also a special case in which duplicate LBs might be created - * in the SB, e.g., due to the fact that OVSDB only ensures - * "at-least-once" consistency for clustered database tables that - * are not indexed in any way. - */ - lb_dps = ovn_lb_datapaths_find(lb_dps_map, &lb_uuid); - if (!lb_dps || (!lb_dps->n_nb_ls && !lb_dps->n_nb_lr) || - !hmapx_add(&existing_lbs, lb_dps)) { - sbrec_load_balancer_delete(sbrec_lb); - continue; - } - - struct sb_lb *sb_lb = xzalloc(sizeof *sb_lb); - sb_lb->lb_uuid = lb_uuid; - sb_lb->slb = sbrec_lb; - hmap_insert(&sb_lbs, &sb_lb->hmap_node, uuid_hash(&lb_uuid)); - - /* Find or create datapath group for this load balancer. */ - if (lb_dps->n_nb_ls) { - struct sbrec_logical_dp_group *ls_datapath_group - = chassis_features->ls_dpg_column - ? sb_lb->slb->ls_datapath_group - : sb_lb->slb->datapath_group; /* deprecated */ - sb_lb->dpg = ovn_dp_group_get_or_create( - ovnsb_txn, &ls_dp_groups, - ls_datapath_group, - lb_dps->n_nb_ls, lb_dps->nb_ls_map, - ods_size(ls_datapaths), true, - ls_datapaths, NULL); - } - if (lb_dps->n_nb_lr) { - sb_lb->lr_dpg = ovn_dp_group_get_or_create( - ovnsb_txn, &lr_dp_groups, - sb_lb->slb->lr_datapath_group, - lb_dps->n_nb_lr, lb_dps->nb_lr_map, - ods_size(lr_datapaths), false, - NULL, lr_datapaths); - } - } - hmapx_destroy(&existing_lbs); - - /* Create SB Load balancer records if not present and sync - * the SB load balancer columns. */ - HMAP_FOR_EACH (lb_dps, hmap_node, lb_dps_map) { - - if (!lb_dps->n_nb_ls && !lb_dps->n_nb_lr) { - continue; - } - - /* Store the fact that northd provides the original (destination IP + - * transport port) tuple. - */ - struct smap options; - smap_clone(&options, &lb_dps->lb->nlb->options); - smap_replace(&options, "hairpin_orig_tuple", "true"); - - struct sb_lb *sb_lb = find_slb_in_sb_lbs(&sb_lbs, - &lb_dps->lb->nlb->header_.uuid); - ovs_assert(!sb_lb || (sb_lb->slb && (sb_lb->dpg || sb_lb->lr_dpg))); - struct ovn_dp_group *lb_dpg = NULL, *lb_lr_dpg = NULL; - if (!sb_lb) { - sbrec_lb = sbrec_load_balancer_insert(ovnsb_txn); - char *lb_id = xasprintf( - UUID_FMT, UUID_ARGS(&lb_dps->lb->nlb->header_.uuid)); - const struct smap external_ids = - SMAP_CONST1(&external_ids, "lb_id", lb_id); - sbrec_load_balancer_set_external_ids(sbrec_lb, &external_ids); - free(lb_id); - } else { - sbrec_lb = sb_lb->slb; - lb_dpg = sb_lb->dpg; - lb_lr_dpg = sb_lb->lr_dpg; - } - - /* Find or create datapath group for this load balancer. */ - if (!lb_dpg && lb_dps->n_nb_ls) { - struct sbrec_logical_dp_group *ls_datapath_group - = chassis_features->ls_dpg_column - ? sbrec_lb->ls_datapath_group - : sbrec_lb->datapath_group; /* deprecated */ - lb_dpg = ovn_dp_group_get_or_create( - ovnsb_txn, &ls_dp_groups, - ls_datapath_group, - lb_dps->n_nb_ls, lb_dps->nb_ls_map, - ods_size(ls_datapaths), true, - ls_datapaths, NULL); - } - if (!lb_lr_dpg && lb_dps->n_nb_lr) { - lb_lr_dpg = ovn_dp_group_get_or_create( - ovnsb_txn, &lr_dp_groups, - sbrec_lb->lr_datapath_group, - lb_dps->n_nb_lr, lb_dps->nb_lr_map, - ods_size(lr_datapaths), false, - NULL, lr_datapaths); - } - - /* Update columns. */ - sbrec_load_balancer_set_name(sbrec_lb, lb_dps->lb->nlb->name); - sbrec_load_balancer_set_vips(sbrec_lb, - ovn_northd_lb_get_vips(lb_dps->lb)); - sbrec_load_balancer_set_protocol(sbrec_lb, lb_dps->lb->nlb->protocol); - - if (chassis_features->ls_dpg_column) { - sbrec_load_balancer_set_ls_datapath_group( - sbrec_lb, lb_dpg ? lb_dpg->dp_group : NULL - ); - sbrec_load_balancer_set_datapath_group(sbrec_lb, NULL); - } else { - /* datapath_group column is deprecated. */ - sbrec_load_balancer_set_ls_datapath_group(sbrec_lb, NULL); - sbrec_load_balancer_set_datapath_group( - sbrec_lb, lb_dpg ? lb_dpg->dp_group : NULL - ); - } - - sbrec_load_balancer_set_lr_datapath_group( - sbrec_lb, lb_lr_dpg ? lb_lr_dpg->dp_group : NULL - ); - sbrec_load_balancer_set_options(sbrec_lb, &options); - /* Clearing 'datapaths' column, since 'dp_group' is in use. */ - sbrec_load_balancer_set_datapaths(sbrec_lb, NULL, 0); - smap_destroy(&options); - } - - struct ovn_dp_group *dpg; - HMAP_FOR_EACH_POP (dpg, node, &ls_dp_groups) { - bitmap_free(dpg->bitmap); - free(dpg); - } - hmap_destroy(&ls_dp_groups); - - HMAP_FOR_EACH_POP (dpg, node, &lr_dp_groups) { - bitmap_free(dpg->bitmap); - free(dpg); - } - hmap_destroy(&lr_dp_groups); - - struct sb_lb *sb_lb; - HMAP_FOR_EACH_POP (sb_lb, hmap_node, &sb_lbs) { - free(sb_lb); - } - hmap_destroy(&sb_lbs); - - /* Datapath_Binding.load_balancers is not used anymore, it's still in the - * schema for compatibility reasons. Reset it to empty, just in case. - */ - struct ovn_datapath *od; - HMAP_FOR_EACH (od, key_node, &ls_datapaths->datapaths) { - ovs_assert(od->nbs); - - if (od->sb->n_load_balancers) { - sbrec_datapath_binding_set_load_balancers(od->sb, NULL, 0); - } - } - HMAP_FOR_EACH (od, key_node, &lr_datapaths->datapaths) { - ovs_assert(od->nbr); - - if (od->sb->n_load_balancers) { - sbrec_datapath_binding_set_load_balancers(od->sb, NULL, 0); - } - } -} - -bool -check_sb_lb_duplicates(const struct sbrec_load_balancer_table *table) -{ - struct sset existing_nb_lb_uuids = - SSET_INITIALIZER(&existing_nb_lb_uuids); - const struct sbrec_load_balancer *sbrec_lb; - bool duplicates = false; - - SBREC_LOAD_BALANCER_TABLE_FOR_EACH (sbrec_lb, table) { - const char *nb_lb_uuid = smap_get(&sbrec_lb->external_ids, "lb_id"); - if (nb_lb_uuid && !sset_add(&existing_nb_lb_uuids, nb_lb_uuid)) { - duplicates = true; - break; - } - } - - sset_destroy(&existing_nb_lb_uuids); - return duplicates; -} - /* Syncs the SB port binding for the ovn_port 'op' of a logical switch port. * Caller should make sure that the OVN SB IDL txn is not NULL. Presently it * only syncs the nat column of port binding corresponding to the 'op->nbsp' */ diff --git a/northd/northd.h b/northd/northd.h index c55041c6ed..8d5f35f1b9 100644 --- a/northd/northd.h +++ b/northd/northd.h @@ -751,12 +751,6 @@ void run_update_worker_pool(int n_threads); const struct ovn_datapath *northd_get_datapath_for_port( const struct hmap *ls_ports, const char *port_name); -void sync_lbs(struct ovsdb_idl_txn *, const struct sbrec_load_balancer_table *, - struct ovn_datapaths *ls_datapaths, - struct ovn_datapaths *lr_datapaths, - struct hmap *lbs, - struct chassis_features *chassis_features); -bool check_sb_lb_duplicates(const struct sbrec_load_balancer_table *); struct lr_lb_nat_data_table; void sync_pbs(struct ovsdb_idl_txn *, struct hmap *ls_ports, diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at index ba30f4b84c..5180c353b3 100644 --- a/tests/ovn-northd.at +++ b/tests/ovn-northd.at @@ -2930,6 +2930,8 @@ sw1_sb_uuid=$(fetch_column datapath_binding _uuid external_ids:name=sw1) echo "$sw0_sb_uuid" > sw_sb_uuids echo "$sw1_sb_uuid" >> sw_sb_uuids +lb0_dp_group=$(fetch_column sb:load_balancer ls_datapath_group name=lb0) + echo echo "__file__:__line__: Check that SB lb0 has sw0 and sw1 in datapaths column." AT_CHECK_UNQUOTED([ovn-sbctl --bare --columns _uuid,datapaths find Logical_DP_Group dnl @@ -2937,6 +2939,8 @@ AT_CHECK_UNQUOTED([ovn-sbctl --bare --columns _uuid,datapaths find Logical_DP_Gr $(cat sw_sb_uuids | sort) ]) +lbg0_dp_group=$(fetch_column sb:load_balancer ls_datapath_group name=lbg0) + echo echo "__file__:__line__: Check that SB lbg0 has sw0 and sw1 in datapaths column." AT_CHECK_UNQUOTED([ovn-sbctl --bare --columns _uuid,datapaths find Logical_DP_Group dnl @@ -10402,7 +10406,7 @@ check ovn-nbctl --wait=sb lb-add lb1 10.0.0.10:80 10.0.0.3:80 check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -10411,7 +10415,7 @@ check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -10421,7 +10425,7 @@ check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -10430,7 +10434,7 @@ check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -10440,7 +10444,7 @@ check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -10498,7 +10502,7 @@ check_engine_stats lr_lb_nat_data norecompute compute # A LB applied to a switch/router triggers: # - a recompute in the first iteration (handling northd change) # - a compute in the second iteration (handling SB update) -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute check_engine_stats ls_lbacls norecompute compute check_engine_stats lflow norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE @@ -10511,7 +10515,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats ls_lbacls norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Cleanup the vip of lb1. @@ -10522,7 +10526,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats ls_lbacls norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Set the vips of lb1 back @@ -10533,7 +10537,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats ls_lbacls norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Add another vip to lb1 @@ -10544,7 +10548,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats ls_lbacls norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Disassociate lb1 from sw0. There should be a full recompute of northd engine node. @@ -10567,7 +10571,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats ls_lbacls norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -10588,7 +10592,7 @@ check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Modify the backend of the lb1 vip @@ -10598,7 +10602,7 @@ check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Cleanup the vip of lb1. @@ -10608,7 +10612,7 @@ check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Set the vips of lb1 back @@ -10618,7 +10622,7 @@ check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Add another vip to lb1 @@ -10628,7 +10632,7 @@ check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -10646,6 +10650,7 @@ lbg1_uuid=$(ovn-nbctl --wait=sb create load_balancer_group name=lbg1) check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lflow norecompute nocompute +check_engine_stats sync_to_sb_lb norecompute nocompute CHECK_NO_CHANGE_AFTER_RECOMPUTE check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -10659,7 +10664,7 @@ check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -10676,7 +10681,7 @@ check ovn-nbctl --wait=sb add load_balancer_group . load_Balancer $lb1_uuid check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -10686,7 +10691,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats ls_lbacls norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute # Update lb and this should not result in northd recompute check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -10696,7 +10701,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats ls_lbacls norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute # Modify the backend of the lb1 vip check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -10706,7 +10711,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats ls_lbacls norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Cleanup the vip of lb1. @@ -10717,7 +10722,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats ls_lbacls norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Set the vips of lb1 back @@ -10728,7 +10733,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats ls_lbacls norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Add another vip to lb1 @@ -10739,7 +10744,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats ls_lbacls norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -10755,7 +10760,7 @@ check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Modify the backend of the lb1 vip @@ -10765,7 +10770,7 @@ check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Cleanup the vip of lb1. @@ -10775,7 +10780,7 @@ check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Set the vips of lb1 back @@ -10785,7 +10790,7 @@ check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Add another vip to lb1 @@ -10795,7 +10800,7 @@ check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -10815,7 +10820,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats ls_lbacls norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -10859,7 +10864,7 @@ check_engine_stats northd norecompute compute check_engine_stats ls_lbacls norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -10869,7 +10874,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats ls_lbacls norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -10878,7 +10883,7 @@ check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -10888,7 +10893,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats ls_lbacls norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -10898,7 +10903,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats ls_lbacls norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -10908,7 +10913,7 @@ check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -10939,7 +10944,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats ls_lbacls norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Deleting lb2 should result in lflow recompute as it is @@ -10951,7 +10956,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats ls_lbacls norecompute compute check_engine_stats lflow norecompute compute -check_engine_stats sync_to_sb_lb recompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -11018,6 +11023,7 @@ check ovn-nbctl --wait=sb ls-lb-add sw0 lb1 check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lflow norecompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Clear the VIPs of lb1 @@ -11026,6 +11032,7 @@ check ovn-nbctl --wait=sb clear load_balancer . vips check_engine_stats lb_data norecompute compute check_engine_stats northd norecompute compute check_engine_stats lflow norecompute compute +check_engine_stats sync_to_sb_lb norecompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE check as northd ovn-appctl -t NORTHD_TYPE inc-engine/clear-stats @@ -11033,6 +11040,7 @@ check ovn-nbctl --wait=sb lb-del lb1 check_engine_stats lb_data norecompute compute check_engine_stats northd recompute nocompute check_engine_stats lflow recompute nocompute +check_engine_stats sync_to_sb_lb recompute compute CHECK_NO_CHANGE_AFTER_RECOMPUTE AT_CLEANUP @@ -11093,6 +11101,7 @@ check_engine_stats northd recompute nocompute check_engine_stats lr_nat recompute nocompute check_engine_stats lr_lb_nat_data recompute nocompute check_engine_stats sync_to_sb_pb recompute nocompute +check_engine_stats sync_to_sb_lb recompute nocompute check_engine_stats lflow recompute nocompute CHECK_NO_CHANGE_AFTER_RECOMPUTE @@ -11106,6 +11115,7 @@ check_engine_stats northd recompute compute check_engine_stats lr_nat recompute nocompute check_engine_stats lr_lb_nat_data recompute nocompute check_engine_stats sync_to_sb_pb recompute nocompute +check_engine_stats sync_to_sb_lb recompute nocompute check_engine_stats lflow recompute nocompute CHECK_NO_CHANGE_AFTER_RECOMPUTE @@ -11118,6 +11128,7 @@ check_engine_stats northd recompute nocompute check_engine_stats lr_nat recompute nocompute check_engine_stats lr_lb_nat_data recompute nocompute check_engine_stats sync_to_sb_pb recompute nocompute +check_engine_stats sync_to_sb_lb recompute nocompute check_engine_stats lflow recompute nocompute CHECK_NO_CHANGE_AFTER_RECOMPUTE @@ -11144,6 +11155,7 @@ check_engine_stats northd recompute nocompute check_engine_stats lr_nat recompute nocompute check_engine_stats lr_lb_nat_data recompute nocompute check_engine_stats sync_to_sb_pb recompute nocompute +check_engine_stats sync_to_sb_lb recompute nocompute check_engine_stats lflow recompute nocompute CHECK_NO_CHANGE_AFTER_RECOMPUTE @@ -11156,6 +11168,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_nat norecompute compute check_engine_stats lflow norecompute compute check_engine_stats sync_to_sb_pb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute nocompute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Update the NAT options column @@ -11165,6 +11178,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_nat norecompute compute check_engine_stats lflow norecompute compute check_engine_stats sync_to_sb_pb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute nocompute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Update the NAT external_ip column @@ -11175,6 +11189,7 @@ check_engine_stats lr_nat norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute check_engine_stats sync_to_sb_pb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute nocompute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Update the NAT logical_ip column @@ -11185,6 +11200,7 @@ check_engine_stats lr_nat norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute check_engine_stats sync_to_sb_pb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute nocompute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Update the NAT type @@ -11195,6 +11211,7 @@ check_engine_stats lr_nat norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute check_engine_stats sync_to_sb_pb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute nocompute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Create a dnat_and_snat NAT with external_mac and logical_port @@ -11205,6 +11222,7 @@ check_engine_stats lr_nat norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute check_engine_stats sync_to_sb_pb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute nocompute CHECK_NO_CHANGE_AFTER_RECOMPUTE nat2_uuid=$(ovn-nbctl --bare --columns _uuid find nat logical_ip=10.0.0.4) @@ -11216,6 +11234,7 @@ check_engine_stats lr_nat norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute check_engine_stats sync_to_sb_pb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute nocompute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Create a load balancer and add the lb vip as NAT @@ -11232,6 +11251,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_nat norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats sync_to_sb_pb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute nocompute check_engine_stats lflow recompute nocompute CHECK_NO_CHANGE_AFTER_RECOMPUTE @@ -11243,6 +11263,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_nat norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats sync_to_sb_pb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute nocompute check_engine_stats lflow recompute nocompute CHECK_NO_CHANGE_AFTER_RECOMPUTE @@ -11254,6 +11275,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_nat norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats sync_to_sb_pb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute nocompute check_engine_stats lflow recompute nocompute CHECK_NO_CHANGE_AFTER_RECOMPUTE @@ -11265,6 +11287,7 @@ check_engine_stats northd norecompute compute check_engine_stats lr_nat norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats sync_to_sb_pb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute nocompute check_engine_stats lflow recompute nocompute CHECK_NO_CHANGE_AFTER_RECOMPUTE @@ -11276,6 +11299,7 @@ check_engine_stats lr_nat norecompute compute check_engine_stats lr_lb_nat_data norecompute compute check_engine_stats lflow norecompute compute check_engine_stats sync_to_sb_pb recompute nocompute +check_engine_stats sync_to_sb_lb norecompute nocompute CHECK_NO_CHANGE_AFTER_RECOMPUTE # Create router Policy @@ -11285,6 +11309,7 @@ check_engine_stats northd recompute nocompute check_engine_stats lr_nat recompute nocompute check_engine_stats lr_lb_nat_data recompute nocompute check_engine_stats sync_to_sb_pb recompute nocompute +check_engine_stats sync_to_sb_lb recompute nocompute check_engine_stats lflow recompute nocompute CHECK_NO_CHANGE_AFTER_RECOMPUTE @@ -11294,6 +11319,7 @@ check_engine_stats northd recompute nocompute check_engine_stats lr_nat recompute nocompute check_engine_stats lr_lb_nat_data recompute nocompute check_engine_stats sync_to_sb_pb recompute nocompute +check_engine_stats sync_to_sb_lb recompute nocompute check_engine_stats lflow recompute nocompute CHECK_NO_CHANGE_AFTER_RECOMPUTE