Skip to content

Commit 8697494

Browse files
svihoalmusil
authored andcommitted
northd: Omit alert for the SB DNS table.
ovn-northd is the only writer of the Southbound DNS table: sync_dns_entries() rewrites the records and datapaths columns from the Northbound contents on every recompute. The write-back of ovn-northd's own transaction therefore alerts the IDL for no reason, and because en_sb_dns has no change handler registered, every such alert forces a full recompute of the en_northd node. Disable IDL alerting for all SB DNS columns, as we already do for the other tables ovn-northd owns. The rows stay replicated, so sync_dns_entries() can still read them; only the change notification is suppressed. Add a test that writes to the SB DNS table directly and checks that the northd engine node neither recomputes nor computes, and that a subsequent recompute restores the records column from the Northbound contents. Signed-off-by: Lana Honcharuk <svitlana.s.honcharuk@gmail.com> Assisted-by: Claude Opus 4.6 Signed-off-by: Ales Musil <amusil@redhat.com>
1 parent d3604be commit 8697494

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

northd/ovn-northd.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,9 @@ main(int argc, char *argv[])
989989
ovsdb_idl_omit_alert(ovnsb_idl_loop.idl,
990990
&sbrec_advertised_mac_binding_columns[i]);
991991
}
992+
for (size_t i = 0; i < SBREC_DNS_N_COLUMNS; i++) {
993+
ovsdb_idl_omit_alert(ovnsb_idl_loop.idl, &sbrec_dns_columns[i]);
994+
}
992995

993996
unixctl_command_register("sb-connection-status", "", 0, 0,
994997
ovn_conn_show, ovnsb_idl_loop.idl);

tests/ovn-northd.at

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12307,6 +12307,53 @@ ignored_dp=lr0])
1230712307
AT_CLEANUP
1230812308
])
1230912309

12310+
OVN_FOR_EACH_NORTHD_NO_HV([
12311+
AT_SETUP([SB DNS incremental processing])
12312+
ovn_start
12313+
12314+
check ovn-nbctl ls-add sw0
12315+
dns_uuid=$(ovn-nbctl create DNS records={})
12316+
check ovn-nbctl set DNS $dns_uuid records:vm1.ovn.org="10.0.0.4"
12317+
check ovn-nbctl set Logical_Switch sw0 dns_records="$dns_uuid"
12318+
check ovn-nbctl --wait=sb sync
12319+
12320+
# ovn-northd syncs the NB DNS record to the SB DNS table.
12321+
wait_row_count sb:DNS 1
12322+
sb_dns_uuid=$(fetch_column sb:DNS _uuid)
12323+
AT_CHECK([ovn-sbctl get DNS $sb_dns_uuid records:vm1.ovn.org], [0], [dnl
12324+
"10.0.0.4"
12325+
])
12326+
12327+
# ovn-northd is the only writer of the SB DNS table and disables IDL
12328+
# alerting for all of its columns, so changes to that table never wake
12329+
# ovn-northd up - not even the write-back of its own transaction. A direct
12330+
# SB write is therefore not noticed at all: the northd node neither
12331+
# recomputes nor computes.
12332+
check as northd ovn-appctl -t ovn-northd inc-engine/clear-stats
12333+
check ovn-sbctl set DNS $sb_dns_uuid records:vm2.ovn.org="10.0.0.5"
12334+
check ovn-nbctl --wait=sb sync
12335+
check_engine_stats northd norecompute nocompute
12336+
check_engine_stats lflow norecompute nocompute
12337+
12338+
# The externally added record is consequently still there.
12339+
AT_CHECK([ovn-sbctl get DNS $sb_dns_uuid records:vm2.ovn.org], [0], [dnl
12340+
"10.0.0.5"
12341+
])
12342+
12343+
# sync_dns_entries() rewrites the records column from the NB contents, so a
12344+
# recompute drops the stale entry without changing anything else.
12345+
CHECK_NO_CHANGE_AFTER_RECOMPUTE
12346+
wait_row_count sb:DNS 0 records:vm2.ovn.org='"10.0.0.5"'
12347+
wait_row_count sb:DNS 1 records:vm1.ovn.org='"10.0.0.4"'
12348+
12349+
# Dropping the NB record removes the SB one as well.
12350+
check ovn-nbctl clear Logical_Switch sw0 dns_records
12351+
check ovn-nbctl --wait=sb sync
12352+
wait_row_count sb:DNS 0
12353+
12354+
AT_CLEANUP
12355+
])
12356+
1231012357
OVN_FOR_EACH_NORTHD_NO_HV([
1231112358
AT_SETUP([ACL/Meter incremental processing - no northd recompute])
1231212359
ovn_start

0 commit comments

Comments
 (0)