From f88be97da354972a6609be3cfb4563941f958947 Mon Sep 17 00:00:00 2001 From: Sami Hiltunen Date: Tue, 28 Jul 2020 10:57:02 +0200 Subject: remove virtual storage wide read-only mode With the introduction of per repository read-only mode, this commit removes the previous virtual storage wide read-only mode implementation. --- internal/praefect/config/config.go | 3 +-- internal/praefect/config/config_test.go | 11 ++++------- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'internal/praefect/config') diff --git a/internal/praefect/config/config.go b/internal/praefect/config/config.go index f3f4a3f87..2f0b81b59 100644 --- a/internal/praefect/config/config.go +++ b/internal/praefect/config/config.go @@ -17,7 +17,6 @@ import ( type Failover struct { Enabled bool `toml:"enabled"` ElectionStrategy string `toml:"election_strategy"` - ReadOnlyAfterFailover bool `toml:"read_only_after_failover"` ErrorThresholdWindow config.Duration `toml:"error_threshold_window"` WriteErrorThresholdCount uint32 `toml:"write_error_threshold_count"` ReadErrorThresholdCount uint32 `toml:"read_error_threshold_count"` @@ -55,7 +54,7 @@ type VirtualStorage struct { func FromFile(filePath string) (Config, error) { conf := &Config{ // Sets the default Failover, to be overwritten when deserializing the TOML - Failover: Failover{Enabled: true, ElectionStrategy: sqlFailoverValue, ReadOnlyAfterFailover: true}, + Failover: Failover{Enabled: true, ElectionStrategy: sqlFailoverValue}, } if _, err := toml.DecodeFile(filePath, conf); err != nil { return Config{}, err diff --git a/internal/praefect/config/config_test.go b/internal/praefect/config/config_test.go index 1aa8087c3..dff855221 100644 --- a/internal/praefect/config/config_test.go +++ b/internal/praefect/config/config_test.go @@ -252,7 +252,6 @@ func TestConfigParsing(t *testing.T) { Failover: Failover{ Enabled: true, ElectionStrategy: sqlFailoverValue, - ReadOnlyAfterFailover: true, ErrorThresholdWindow: config.Duration(20 * time.Second), WriteErrorThresholdCount: 1500, ReadErrorThresholdCount: 100, @@ -265,9 +264,8 @@ func TestConfigParsing(t *testing.T) { expected: Config{ GracefulStopTimeout: config.Duration(time.Minute), Failover: Failover{ - Enabled: false, - ElectionStrategy: "local", - ReadOnlyAfterFailover: false, + Enabled: false, + ElectionStrategy: "local", }, }, }, @@ -277,9 +275,8 @@ func TestConfigParsing(t *testing.T) { expected: Config{ GracefulStopTimeout: config.Duration(time.Minute), Failover: Failover{ - Enabled: true, - ElectionStrategy: sqlFailoverValue, - ReadOnlyAfterFailover: true, + Enabled: true, + ElectionStrategy: sqlFailoverValue, }, }, }, -- cgit v1.2.3