Skip to content

Commit fb71051

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> (cherry picked from commit 8697494)
1 parent 00b2f18 commit fb71051

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
@@ -12233,6 +12233,53 @@ ignored_dp=lr0])
1223312233
AT_CLEANUP
1223412234
])
1223512235

12236+
OVN_FOR_EACH_NORTHD_NO_HV([
12237+
AT_SETUP([SB DNS incremental processing])
12238+
ovn_start
12239+
12240+
check ovn-nbctl ls-add sw0
12241+
dns_uuid=$(ovn-nbctl create DNS records={})
12242+
check ovn-nbctl set DNS $dns_uuid records:vm1.ovn.org="10.0.0.4"
12243+
check ovn-nbctl set Logical_Switch sw0 dns_records="$dns_uuid"
12244+
check ovn-nbctl --wait=sb sync
12245+
12246+
# ovn-northd syncs the NB DNS record to the SB DNS table.
12247+
wait_row_count sb:DNS 1
12248+
sb_dns_uuid=$(fetch_column sb:DNS _uuid)
12249+
AT_CHECK([ovn-sbctl get DNS $sb_dns_uuid records:vm1.ovn.org], [0], [dnl
12250+
"10.0.0.4"
12251+
])
12252+
12253+
# ovn-northd is the only writer of the SB DNS table and disables IDL
12254+
# alerting for all of its columns, so changes to that table never wake
12255+
# ovn-northd up - not even the write-back of its own transaction. A direct
12256+
# SB write is therefore not noticed at all: the northd node neither
12257+
# recomputes nor computes.
12258+
check as northd ovn-appctl -t ovn-northd inc-engine/clear-stats
12259+
check ovn-sbctl set DNS $sb_dns_uuid records:vm2.ovn.org="10.0.0.5"
12260+
check ovn-nbctl --wait=sb sync
12261+
check_engine_stats northd norecompute nocompute
12262+
check_engine_stats lflow norecompute nocompute
12263+
12264+
# The externally added record is consequently still there.
12265+
AT_CHECK([ovn-sbctl get DNS $sb_dns_uuid records:vm2.ovn.org], [0], [dnl
12266+
"10.0.0.5"
12267+
])
12268+
12269+
# sync_dns_entries() rewrites the records column from the NB contents, so a
12270+
# recompute drops the stale entry without changing anything else.
12271+
CHECK_NO_CHANGE_AFTER_RECOMPUTE
12272+
wait_row_count sb:DNS 0 records:vm2.ovn.org='"10.0.0.5"'
12273+
wait_row_count sb:DNS 1 records:vm1.ovn.org='"10.0.0.4"'
12274+
12275+
# Dropping the NB record removes the SB one as well.
12276+
check ovn-nbctl clear Logical_Switch sw0 dns_records
12277+
check ovn-nbctl --wait=sb sync
12278+
wait_row_count sb:DNS 0
12279+
12280+
AT_CLEANUP
12281+
])
12282+
1223612283
OVN_FOR_EACH_NORTHD_NO_HV([
1223712284
AT_SETUP([ACL/Meter incremental processing - no northd recompute])
1223812285
ovn_start

0 commit comments

Comments
 (0)