Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reinstate database rule netbox_close_arp and delete netbox_status_close_arp instead #2928

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/2910.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Replace incorrect fix for premature ARP record closure introduced in 5.10.1
12 changes: 12 additions & 0 deletions python/nav/models/sql/changes/sc.05.10.0002.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- Reinstate rule that closes ARP records on netbox deletion, see #2910
CREATE OR REPLACE RULE netbox_close_arp AS ON DELETE TO netbox
DO UPDATE arp SET end_time=NOW()
WHERE netboxid=OLD.netboxid AND end_time='infinity';

-- Close all open ARP records that have no associated netbox (those that may have been kept open in error due to
-- deletions between 5.10.1 and 5.10.2)
UPDATE arp SET end_time=NOW()
WHERE end_time>='infinity' AND netboxid IS NULL;

-- Remove actually malfunctioning ARP record closing rule, see #2910
DROP RULE IF EXISTS netbox_status_close_arp ON netbox;
Loading