Skip to content

chore: disable pgcoord (HA) when --in-memory #12919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion enterprise/coderd/coderd.go
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,13 @@ func (api *API) updateEntitlements(ctx context.Context) error {

if initial, changed, enabled := featureChanged(codersdk.FeatureHighAvailability); shouldUpdate(initial, changed, enabled) {
var coordinator agpltailnet.Coordinator
if enabled {
// If HA is enabled, but the database is in-memory, we can't actually
// run HA and the PG coordinator. So throw a log line, and continue to use
// the in memory AGPL coordinator.
if enabled && api.DeploymentValues.InMemoryDatabase.Value() {
api.Logger.Warn(ctx, "high availability is enabled, but cannot be configured due to the database being set to in-memory")
}
if enabled && !api.DeploymentValues.InMemoryDatabase.Value() {
haCoordinator, err := tailnet.NewPGCoord(api.ctx, api.Logger, api.Pubsub, api.Database)
if err != nil {
api.Logger.Error(ctx, "unable to set up high availability coordinator", slog.Error(err))
Expand Down
11 changes: 2 additions & 9 deletions site/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import { defineConfig } from "@playwright/test";
import * as path from "path";
import {
coderMain,
coderPort,
coderdPProfPort,
enterpriseLicense,
gitAuth,
} from "./constants";
import { coderMain, coderPort, coderdPProfPort, gitAuth } from "./constants";

export const wsEndpoint = process.env.CODER_E2E_WS_ENDPOINT;

Expand Down Expand Up @@ -54,8 +48,7 @@ export default defineConfig({
"--global-config $(mktemp -d -t e2e-XXXXXXXXXX)",
`--access-url=http://localhost:${coderPort}`,
`--http-address=localhost:${coderPort}`,
// Adding an enterprise license causes issues with pgcoord when running with `--in-memory`.
!enterpriseLicense && "--in-memory",
"--in-memory",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prolly don't need the comment above this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. 👍

"--telemetry=false",
"--dangerous-disable-rate-limits",
"--provisioner-daemons 10",
Expand Down
Loading