Skip to content

Commit

Permalink
expr.c: Remove backwards compatibility lookup in parse_port_group().
Browse files Browse the repository at this point in the history
It's been more than 2.5 years since the first release in which northd
started storing SB.Port_Group.name as
<Logical_Datapath.tunnel_key_NB-Port_Group.name> after bff01d4 ("Split
SB Port_Group per datapath.").

There's a safe upgrade path via the LTS release for deployments that
still run older ovn-controller versions.

Signed-off-by: Dumitru Ceara <dceara@redhat.com>
Acked-by: Han Zhou <hzhou@ovn.org>
  • Loading branch information
dceara committed Jun 21, 2023
1 parent 9f4550e commit be69d6b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
8 changes: 0 additions & 8 deletions TODO.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,6 @@ OVN To-do List

* Packaging for Debian.

* ovn-controller: Remove backwards compatibility for Southbound DB Port_Group
names in expr.c a few releases after the 20.09 version. Right now
ovn-controller maintains backwards compatibility when connecting to a
SB database that doesn't store Port_Group.name as
<Logical_Datapath.tunnel_key_NB-Port_Group.name>. This causes an additional
hashtable lookup in parse_port_group() which can be avoided when we are sure
that the Southbound DB uses the new format.

* ovn-northd-ddlog: Calls to warn() and err() from DDlog code would be
better refactored to use the Warning[] relation (and introduce an
Error[] relation once we want to issue some errors that way). This
Expand Down
12 changes: 0 additions & 12 deletions lib/expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -845,18 +845,6 @@ parse_port_group(struct expr_context *ctx, struct expr_constant_set *cs,

if (ctx->port_groups) {
port_group = shash_find_data(ctx->port_groups, ds_cstr(&sb_name));
if (!port_group) {
/* For backwards compatibility (e.g., ovn-controller was
* upgraded but ovn-northd not yet), perform an additional
* lookup because the NB Port_Group.name might have been
* stored as is in the SB Port_Group.name field.
*/
port_group = shash_find_data(ctx->port_groups,
ctx->lexer->token.s);
if (ctx->port_groups_ref) {
sset_add(ctx->port_groups_ref, ctx->lexer->token.s);
}
}
}
ds_destroy(&sb_name);

Expand Down

0 comments on commit be69d6b

Please sign in to comment.