diff options
author | Sami Hiltunen <shiltunen@gitlab.com> | 2020-07-28 11:57:02 +0300 |
---|---|---|
committer | Sami Hiltunen <shiltunen@gitlab.com> | 2020-07-30 18:06:59 +0300 |
commit | f88be97da354972a6609be3cfb4563941f958947 (patch) | |
tree | 16f8a96a31e2c581cb301935612453bf62b8b9e5 /internal/praefect/config | |
parent | db7767ad3febe68c4f376886d62a05bba5200f83 (diff) |
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.
Diffstat (limited to 'internal/praefect/config')
-rw-r--r-- | internal/praefect/config/config.go | 3 | ||||
-rw-r--r-- | internal/praefect/config/config_test.go | 11 |
2 files changed, 5 insertions, 9 deletions
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, }, }, }, |