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
+17
-12
@@ -5558,18 +5558,23 @@ type ProvisionerKey struct {
|
||||
}
|
||||
|
||||
type Replica struct {
|
||||
ID uuid.UUID `db:"id" json:"id"`
|
||||
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
||||
StartedAt time.Time `db:"started_at" json:"started_at"`
|
||||
StoppedAt sql.NullTime `db:"stopped_at" json:"stopped_at"`
|
||||
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
|
||||
Hostname string `db:"hostname" json:"hostname"`
|
||||
RegionID int32 `db:"region_id" json:"region_id"`
|
||||
RelayAddress string `db:"relay_address" json:"relay_address"`
|
||||
DatabaseLatency int32 `db:"database_latency" json:"database_latency"`
|
||||
Version string `db:"version" json:"version"`
|
||||
Error string `db:"error" json:"error"`
|
||||
Primary bool `db:"primary" json:"primary"`
|
||||
ID uuid.UUID `db:"id" json:"id"`
|
||||
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
||||
StartedAt time.Time `db:"started_at" json:"started_at"`
|
||||
StoppedAt sql.NullTime `db:"stopped_at" json:"stopped_at"`
|
||||
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
|
||||
Hostname string `db:"hostname" json:"hostname"`
|
||||
RegionID int32 `db:"region_id" json:"region_id"`
|
||||
// URL for DERP relays.
|
||||
RelayAddress string `db:"relay_address" json:"relay_address"`
|
||||
DatabaseLatency int32 `db:"database_latency" json:"database_latency"`
|
||||
Version string `db:"version" json:"version"`
|
||||
Error string `db:"error" json:"error"`
|
||||
Primary bool `db:"primary" json:"primary"`
|
||||
// Hostname or IP address the replica is reachable at for clustering purposes.
|
||||
ClusterHost string `db:"cluster_host" json:"cluster_host"`
|
||||
// Port number for NATS clustering. 0 means NATS is disabled.
|
||||
NATSPort int32 `db:"nats_port" json:"nats_port"`
|
||||
}
|
||||
|
||||
type SiteConfig struct {
|
||||
|
||||
Reference in New Issue
Block a user