Files
Alexandr Stelnykovych 7dd9e195b5 fix(netquery): remove bandwidth data of deleted connections
main.bandwidth declares ON DELETE CASCADE on conn_id, but foreign keys
are never enabled on the connection, so the cascade never runs. Cleanup
deleted the connections and left their bandwidth rows behind: one row
per connection per second of traffic, kept in memory for the whole
uptime of the process.

Delete the bandwidth rows of the connections that Cleanup is about to
remove, before removing them, and index conn_id, which the bandwidth
chart joins on and the cleanup deletes through. The delete is limited
to the connections being removed, so its cost does not grow with the
rows of live connections, and a bandwidth update that arrives before
its connection is saved is left alone.

Add a test for the cleanup and the index.
2026-10-27 18:11:39 +02:00
..
2025-04-15 11:26:59 +02:00
2026-09-28 15:52:18 +03:00
2024-08-09 18:15:48 +03:00
2024-08-28 11:55:40 +02:00