Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.

Commit 0fa7486

Browse files
committed
Disable running Promscale in both HA and read-only mode
This was not possible before with legacy HA, but was missed when updating to non-legacy HA. It doesn't make sense to try to combine these two operation modes.
1 parent 8aaf5c5 commit 0fa7486

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ We use the following categories for changes:
2424
### Changed
2525
- Enable tracing by default [#1213]
2626
- The Promscale extension is now required, while the Timescaledb extension remains optional. The minimum Timescaledb version supported is now 2.6.0 [#1132]
27+
- Disable running Promscale in HA and read-only simultaneously [#1254]
2728

2829
### Fixed
2930
- Register `promscale_ingest_channel_len_bucket` metric and make it a gauge [#1177]

pkg/runner/flags.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ func ParseFlags(cfg *Config, args []string) (*Config, error) {
208208
if flagset["install-extensions"] && cfg.InstallExtensions {
209209
return nil, fmt.Errorf("Cannot install or update TimescaleDB extension in read-only mode")
210210
}
211+
if flagset["metrics.high-availability"] && cfg.APICfg.HighAvailability {
212+
return nil, fmt.Errorf("cannot run Promscale in both HA and read-only mode")
213+
}
211214
cfg.Migrate = false
212215
cfg.StopAfterMigrate = false
213216
cfg.UseVersionLease = false

pkg/runner/flags_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func TestParseFlags(t *testing.T) {
108108
{
109109
name: "Running HA and read-only error",
110110
args: []string{
111-
"-leader-election-pg-advisory-lock-id", "1",
111+
"-metrics.high-availability",
112112
"-read-only",
113113
},
114114
shouldError: true,

0 commit comments

Comments
 (0)