Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a607d56

Browse files
authored
chore: disable pgcoord (HA) when --in-memory (#12919)
* chore: disable pgcoord (HA) when --in-memory HA does not make any sense while using in-memory database
1 parent 838e8df commit a607d56

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

enterprise/coderd/coderd.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,13 @@ func (api *API) updateEntitlements(ctx context.Context) error {
630630

631631
if initial, changed, enabled := featureChanged(codersdk.FeatureHighAvailability); shouldUpdate(initial, changed, enabled) {
632632
var coordinator agpltailnet.Coordinator
633-
if enabled {
633+
// If HA is enabled, but the database is in-memory, we can't actually
634+
// run HA and the PG coordinator. So throw a log line, and continue to use
635+
// the in memory AGPL coordinator.
636+
if enabled && api.DeploymentValues.InMemoryDatabase.Value() {
637+
api.Logger.Warn(ctx, "high availability is enabled, but cannot be configured due to the database being set to in-memory")
638+
}
639+
if enabled && !api.DeploymentValues.InMemoryDatabase.Value() {
634640
haCoordinator, err := tailnet.NewPGCoord(api.ctx, api.Logger, api.Pubsub, api.Database)
635641
if err != nil {
636642
api.Logger.Error(ctx, "unable to set up high availability coordinator", slog.Error(err))

site/e2e/playwright.config.ts

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import { defineConfig } from "@playwright/test";
22
import * as path from "path";
3-
import {
4-
coderMain,
5-
coderPort,
6-
coderdPProfPort,
7-
enterpriseLicense,
8-
gitAuth,
9-
} from "./constants";
3+
import { coderMain, coderPort, coderdPProfPort, gitAuth } from "./constants";
104

115
export const wsEndpoint = process.env.CODER_E2E_WS_ENDPOINT;
126

@@ -54,8 +48,7 @@ export default defineConfig({
5448
"--global-config $(mktemp -d -t e2e-XXXXXXXXXX)",
5549
`--access-url=http://localhost:${coderPort}`,
5650
`--http-address=localhost:${coderPort}`,
57-
// Adding an enterprise license causes issues with pgcoord when running with `--in-memory`.
58-
!enterpriseLicense && "--in-memory",
51+
"--in-memory",
5952
"--telemetry=false",
6053
"--dangerous-disable-rate-limits",
6154
"--provisioner-daemons 10",

0 commit comments

Comments
 (0)