Skip to content

Commit adfc375

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 b17ac57 commit adfc375

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
@@ -983,6 +983,9 @@ main(int argc, char *argv[])
983983
ovsdb_idl_omit_alert(ovnsb_idl_loop.idl,
984984
&sbrec_advertised_mac_binding_columns[i]);
985985
}
986+
for (size_t i = 0; i < SBREC_DNS_N_COLUMNS; i++) {
987+
ovsdb_idl_omit_alert(ovnsb_idl_loop.idl, &sbrec_dns_columns[i]);
988+
}
986989

987990
unixctl_command_register("sb-connection-status", "", 0, 0,
988991
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
@@ -12058,6 +12058,53 @@ ignored_dp=lr0])
1205812058
AT_CLEANUP
1205912059
])
1206012060

12061+
OVN_FOR_EACH_NORTHD_NO_HV([
12062+
AT_SETUP([SB DNS incremental processing])
12063+
ovn_start
12064+
12065+
check ovn-nbctl ls-add sw0
12066+
dns_uuid=$(ovn-nbctl create DNS records={})
12067+
check ovn-nbctl set DNS $dns_uuid records:vm1.ovn.org="10.0.0.4"
12068+
check ovn-nbctl set Logical_Switch sw0 dns_records="$dns_uuid"
12069+
check ovn-nbctl --wait=sb sync
12070+
12071+
# ovn-northd syncs the NB DNS record to the SB DNS table.
12072+
wait_row_count sb:DNS 1
12073+
sb_dns_uuid=$(fetch_column sb:DNS _uuid)
12074+
AT_CHECK([ovn-sbctl get DNS $sb_dns_uuid records:vm1.ovn.org], [0], [dnl
12075+
"10.0.0.4"
12076+
])
12077+
12078+
# ovn-northd is the only writer of the SB DNS table and disables IDL
12079+
# alerting for all of its columns, so changes to that table never wake
12080+
# ovn-northd up - not even the write-back of its own transaction. A direct
12081+
# SB write is therefore not noticed at all: the northd node neither
12082+
# recomputes nor computes.
12083+
check as northd ovn-appctl -t ovn-northd inc-engine/clear-stats
12084+
check ovn-sbctl set DNS $sb_dns_uuid records:vm2.ovn.org="10.0.0.5"
12085+
check ovn-nbctl --wait=sb sync
12086+
check_engine_stats northd norecompute nocompute
12087+
check_engine_stats lflow norecompute nocompute
12088+
12089+
# The externally added record is consequently still there.
12090+
AT_CHECK([ovn-sbctl get DNS $sb_dns_uuid records:vm2.ovn.org], [0], [dnl
12091+
"10.0.0.5"
12092+
])
12093+
12094+
# sync_dns_entries() rewrites the records column from the NB contents, so a
12095+
# recompute drops the stale entry without changing anything else.
12096+
CHECK_NO_CHANGE_AFTER_RECOMPUTE
12097+
wait_row_count sb:DNS 0 records:vm2.ovn.org='"10.0.0.5"'
12098+
wait_row_count sb:DNS 1 records:vm1.ovn.org='"10.0.0.4"'
12099+
12100+
# Dropping the NB record removes the SB one as well.
12101+
check ovn-nbctl clear Logical_Switch sw0 dns_records
12102+
check ovn-nbctl --wait=sb sync
12103+
wait_row_count sb:DNS 0
12104+
12105+
AT_CLEANUP
12106+
])
12107+
1206112108
OVN_FOR_EACH_NORTHD_NO_HV([
1206212109
AT_SETUP([ACL/Meter incremental processing - no northd recompute])
1206312110
ovn_start

0 commit comments

Comments
 (0)