From 89c13c221291cc8ae2d92f41332e1ffa8910ddc2 Mon Sep 17 00:00:00 2001 From: Spike Curtis Date: Wed, 22 Nov 2023 14:46:55 +0400 Subject: [PATCH] fix: enable FeatureHighAvailability if it is licensed (#10834) fixes #10810 The tailnet coordinators don't depend on replicasync, so we can still enable HA coordinators even if the relay URL is unset. The in-memory, non-HA coordinator probably has lower latency than the PG Coordinator, since we have to query the database, so enterprise customers might want to disable it for single-replica deployments, but this PR default-enables the HA coordinator. We could add support later to disable it if anyone complains. Latency setting up connections matters, but I don't believe the coordinator contributes significantly at this point for reasonable postgres round-trip-time. --- codersdk/deployment.go | 1 + enterprise/coderd/coderd.go | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/codersdk/deployment.go b/codersdk/deployment.go index 4f2e84adbc..56dd5b38f0 100644 --- a/codersdk/deployment.go +++ b/codersdk/deployment.go @@ -95,6 +95,7 @@ func (n FeatureName) AlwaysEnable() bool { FeatureExternalProvisionerDaemons: true, FeatureAppearance: true, FeatureWorkspaceBatchActions: true, + FeatureHighAvailability: true, }[n] } diff --git a/enterprise/coderd/coderd.go b/enterprise/coderd/coderd.go index 55defaf9b9..1a34d594ce 100644 --- a/enterprise/coderd/coderd.go +++ b/enterprise/coderd/coderd.go @@ -472,7 +472,6 @@ func (api *API) updateEntitlements(ctx context.Context) error { codersdk.FeatureAuditLog: api.AuditLogging, codersdk.FeatureBrowserOnly: api.BrowserOnly, codersdk.FeatureSCIM: len(api.SCIMAPIKey) != 0, - codersdk.FeatureHighAvailability: api.DERPServerRelayAddress != "", codersdk.FeatureMultipleExternalAuth: len(api.ExternalAuthConfigs) > 1, codersdk.FeatureTemplateRBAC: api.RBAC, codersdk.FeatureExternalTokenEncryption: len(api.ExternalTokenEncryption) > 0,