mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: add replica_host and nats_port to replicas table (#26665)
relates to GRU-69 Adds cluster_host and nats_port to replicas table, to explicitly track NATS routes in the cluster. I decided to make the NATS support explicit and transport the port number over the replicasync so that different Coder Servers can run on different ports. This is not something customers will typically care about, but is very useful for testing, so that they can all run on localhost within one machine. I've also gone with a design where the NATS pubsub directly tells replicasync the port number _after_ it opens the socket. This is also very useful for testing because it allows us to have the OS assign the port number at runtime, avoiding races where we fail to bind to a free port.
This commit is contained in:
Generated
+10
-1
@@ -2791,9 +2791,18 @@ CREATE TABLE replicas (
|
||||
database_latency integer NOT NULL,
|
||||
version text NOT NULL,
|
||||
error text DEFAULT ''::text NOT NULL,
|
||||
"primary" boolean DEFAULT true NOT NULL
|
||||
"primary" boolean DEFAULT true NOT NULL,
|
||||
cluster_host text DEFAULT ''::text NOT NULL,
|
||||
nats_port integer DEFAULT 0 NOT NULL,
|
||||
CONSTRAINT nats_port_valid_tcp CHECK (((nats_port >= 0) AND (nats_port <= 65535)))
|
||||
);
|
||||
|
||||
COMMENT ON COLUMN replicas.relay_address IS 'URL for DERP relays.';
|
||||
|
||||
COMMENT ON COLUMN replicas.cluster_host IS 'Hostname or IP address the replica is reachable at for clustering purposes.';
|
||||
|
||||
COMMENT ON COLUMN replicas.nats_port IS 'Port number for NATS clustering. 0 means NATS is disabled.';
|
||||
|
||||
CREATE TABLE site_configs (
|
||||
key character varying(256) NOT NULL,
|
||||
value text NOT NULL
|
||||
|
||||
Reference in New Issue
Block a user