Jon Ayers
6b9637d85a
feat: replace pgcoordinator pg_notify triggers with app-level Publish() ( #24717 )
2026-05-01 15:00:08 -05:00
Jon Ayers
333503f74e
feat: improve coordinator peer mapping performance ( #23696 )
...
- Skipping DB querying entirely for peers that aren't actually connected
to our coordinator
- Opportunistically batching the queries for peers
2026-04-03 14:22:58 -05:00
Spike Curtis
f47f89d997
chore: remove unused tailnet v1 tables and queries ( #21646 )
...
Removes the legacy tailnet v1 API tables (`tailnet_clients`, `tailnet_agents`, `tailnet_client_subscriptions`) and their associated queries, triggers, and functions. These were superseded by the v2 tables (`tailnet_peers`, `tailnet_tunnels`) in migration 000168, and the v1 API code was removed in commit d6154c4310 , but the database artifacts were never cleaned up.
**Changes:**
- New migration `000410_remove_tailnet_v1_tables` to drop the unused tables
- Removed 11 unused queries from `tailnet.sql`
- Removed associated manual wrapper methods in `dbauthz` and `dbmetrics`
- ~930 lines deleted across 11 files
2026-01-26 14:27:17 +04:00
Spike Curtis
229d05193d
fix: speed up GetTailnetTunnelPeerBindings query ( #19444 )
...
relates to: https://github.com/coder/internal/issues/718
Optimizes the GetTailnetTunnelPeerBindings query to reduce its execution time.
Before: https://explain.dalibo.com/plan/c2fd53f913aah21c
After: https://explain.dalibo.com/plan/6bc67d323g7afh61
At a high level, we first assemble the total list of peer IDs needed by the query, and only then go into the `tailnet_peers` table to extract their info. This saves us some time instead of hashing the entire `tailnet_peers` table.
2025-08-21 07:53:56 +02:00
Jon Ayers
4fc047954e
fix: avoid deleting peers on graceful close ( #14165 )
...
* fix: avoid deleting peers on graceful close
- Fixes an issue where a coordinator deletes all
its peers on shutdown. This can cause disconnects
whenever a coderd is redeployed.
2024-08-14 15:16:08 -04:00
Steven Masley
0181e036f6
chore: remove unused query failing to prepare ( #11167 )
2023-12-12 15:02:15 -06:00
Spike Curtis
571d358e4b
feat: add queries to clean lost connections in PGCoordinator ( #10938 )
...
Adds cleanup queries to clean out "lost" peer and tunnel state after 24 hours. We leave this state in the database so that anything trying to connect to the peer can see that it was lost, but clean it up after 24 hours to ensure our table doesn't grow without bounds.
2023-12-01 10:02:30 +04:00
Spike Curtis
2b71e38b31
feat: add status to tailnet mapping query ( #10936 )
...
Adds the `status` column to the mapping query so that we can add graceful disconnect logic around it
2023-11-29 16:53:01 +04:00
Spike Curtis
14bd489af6
feat: add queries for PGCoord HTMLDebug ( #10913 )
...
Adds queries for implementing HTMLDebug on the new PGCoordinator
2023-11-28 20:19:32 +04:00
Spike Curtis
1516c6636b
feat: add SQL queries for v2 PG Coordinator ( #10572 )
...
re #10528
Adds SQL queries to support Tailnet v2 API in the PG Coordinator
2023-11-15 10:13:27 +04:00
Colin Adler
c900b5f8df
feat: add single tailnet support to pgcoord ( #9351 )
2023-09-21 14:30:48 -05:00
Colin Adler
0b4f333a6f
chore: add http debug support to pgcoord ( #8795 )
2023-07-28 17:59:31 -05:00
Spike Curtis
ba9d038d42
feat: add periodic cleanup of PG Coordinator state ( #8142 )
...
* PG Coordinator cleans orphaned state
Signed-off-by: Spike Curtis <spike@coder.com >
* Don't need pubsub
Signed-off-by: Spike Curtis <spike@coder.com >
---------
Signed-off-by: Spike Curtis <spike@coder.com >
2023-06-23 13:23:28 +04:00
Spike Curtis
cc17d2feea
refactor: add postgres tailnet coordinator ( #8044 )
...
* postgres tailnet coordinator
Signed-off-by: Spike Curtis <spike@coder.com >
* Fix db migration; tests
Signed-off-by: Spike Curtis <spike@coder.com >
* Add fixture, regenerate
Signed-off-by: Spike Curtis <spike@coder.com >
* Fix fixtures
Signed-off-by: Spike Curtis <spike@coder.com >
* review comments, run clean gen
Signed-off-by: Spike Curtis <spike@coder.com >
* Rename waitForConn -> cleanupConn
Signed-off-by: Spike Curtis <spike@coder.com >
* code review updates
Signed-off-by: Spike Curtis <spike@coder.com >
* db migration order
Signed-off-by: Spike Curtis <spike@coder.com >
* fix log field name last_heartbeat
Signed-off-by: Spike Curtis <spike@coder.com >
* fix heartbeat_from log field
Signed-off-by: Spike Curtis <spike@coder.com >
* fix slog fields for linting
Signed-off-by: Spike Curtis <spike@coder.com >
---------
Signed-off-by: Spike Curtis <spike@coder.com >
2023-06-21 16:20:58 +04:00