diff --git a/README.md b/README.md index 9b7bdb08c..15825573e 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ read the [tutorial](./docs/Manual/Tutorials/Kubernetes/README.md). The ArangoDB Kubernetes Operator is still in **heavy development**. -Running ArangoDB deployments (single, resilient-single or cluster) +Running ArangoDB deployments (single, active-failover or cluster) is becoming reasonably stable, but you should **not yet use it for production environments**. diff --git a/docs/Manual/Deployment/Kubernetes/DeploymentResource.md b/docs/Manual/Deployment/Kubernetes/DeploymentResource.md index 390b14e54..4a93e71c2 100644 --- a/docs/Manual/Deployment/Kubernetes/DeploymentResource.md +++ b/docs/Manual/Deployment/Kubernetes/DeploymentResource.md @@ -51,10 +51,10 @@ Below you'll find all settings of the `ArangoDeployment` custom resource. Several settings are for various groups of servers. These are indicated with `` where `` can be any of: -- `agents` for all agents of a `Cluster` or `ResilientSingle` pair. +- `agents` for all agents of a `Cluster` or `ActiveFailover` pair. - `dbservers` for all dbservers of a `Cluster`. - `coordinators` for all coordinators of a `Cluster`. -- `single` for all single servers of a `Single` instance or `ResilientSingle` pair. +- `single` for all single servers of a `Single` instance or `ActiveFailover` pair. - `syncmasters` for all syncmasters of a `Cluster`. - `syncworkers` for all syncworkers of a `Cluster`. @@ -64,7 +64,7 @@ This setting specifies the type of deployment you want to create. Possible values are: - `Cluster` (default) Full cluster. Defaults to 3 agents, 3 dbservers & 3 coordinators. -- `ResilientSingle` Resilient single pair. Defaults to 3 agents and 2 single servers. +- `ActiveFailover` Active-failover single pair. Defaults to 3 agents and 2 single servers. - `Single` Single server only (note this does not provide high availability or reliability). This setting cannot be changed after the deployment has been created. @@ -254,7 +254,7 @@ The default is `false`. This setting specifies the number of servers to start for the given group. For the agent group, this value must be a positive, odd number. The default value is `3` for all groups except `single` (there the default is `1` -for `spec.mode: single` and `2` for `spec.mode: resilientsingle`). +for `spec.mode: Single` and `2` for `spec.mode: ActiveFailover`). For the `syncworkers` group, it is highly recommended to use the same number as for the `dbservers` group. diff --git a/pkg/apis/deployment/v1alpha/deployment_mode.go b/pkg/apis/deployment/v1alpha/deployment_mode.go index c7d40f9a3..ebf06b28c 100644 --- a/pkg/apis/deployment/v1alpha/deployment_mode.go +++ b/pkg/apis/deployment/v1alpha/deployment_mode.go @@ -32,8 +32,8 @@ type DeploymentMode string const ( // DeploymentModeSingle yields a single server DeploymentModeSingle DeploymentMode = "Single" - // DeploymentModeResilientSingle yields an agency and a resilient-single server pair - DeploymentModeResilientSingle DeploymentMode = "ResilientSingle" + // DeploymentModeActiveFailover yields an agency and a active-failover server pair + DeploymentModeActiveFailover DeploymentMode = "ActiveFailover" // DeploymentModeCluster yields an full cluster (agency, dbservers & coordinators) DeploymentModeCluster DeploymentMode = "Cluster" ) @@ -42,21 +42,21 @@ const ( // Return errors when validation fails, nil on success. func (m DeploymentMode) Validate() error { switch m { - case DeploymentModeSingle, DeploymentModeResilientSingle, DeploymentModeCluster: + case DeploymentModeSingle, DeploymentModeActiveFailover, DeploymentModeCluster: return nil default: return maskAny(errors.Wrapf(ValidationError, "Unknown deployment mode: '%s'", string(m))) } } -// HasSingleServers returns true when the given mode is "Single" or "ResilientSingle". +// HasSingleServers returns true when the given mode is "Single" or "ActiveFailover". func (m DeploymentMode) HasSingleServers() bool { - return m == DeploymentModeSingle || m == DeploymentModeResilientSingle + return m == DeploymentModeSingle || m == DeploymentModeActiveFailover } -// HasAgents returns true when the given mode is "ResilientSingle" or "Cluster". +// HasAgents returns true when the given mode is "ActiveFailover" or "Cluster". func (m DeploymentMode) HasAgents() bool { - return m == DeploymentModeResilientSingle || m == DeploymentModeCluster + return m == DeploymentModeActiveFailover || m == DeploymentModeCluster } // HasDBServers returns true when the given mode is "Cluster". diff --git a/pkg/apis/deployment/v1alpha/deployment_mode_test.go b/pkg/apis/deployment/v1alpha/deployment_mode_test.go index b655281b7..da60c1782 100644 --- a/pkg/apis/deployment/v1alpha/deployment_mode_test.go +++ b/pkg/apis/deployment/v1alpha/deployment_mode_test.go @@ -31,7 +31,7 @@ import ( func TestDeploymentModeValidate(t *testing.T) { // Valid assert.Nil(t, DeploymentMode("Single").Validate()) - assert.Nil(t, DeploymentMode("ResilientSingle").Validate()) + assert.Nil(t, DeploymentMode("ActiveFailover").Validate()) assert.Nil(t, DeploymentMode("Cluster").Validate()) // Not valid @@ -39,30 +39,30 @@ func TestDeploymentModeValidate(t *testing.T) { assert.Error(t, DeploymentMode(" cluster").Validate()) assert.Error(t, DeploymentMode("singles").Validate()) assert.Error(t, DeploymentMode("single").Validate()) - assert.Error(t, DeploymentMode("resilientsingle").Validate()) + assert.Error(t, DeploymentMode("activefailover").Validate()) assert.Error(t, DeploymentMode("cluster").Validate()) } func TestDeploymentModeHasX(t *testing.T) { assert.True(t, DeploymentModeSingle.HasSingleServers()) - assert.True(t, DeploymentModeResilientSingle.HasSingleServers()) + assert.True(t, DeploymentModeActiveFailover.HasSingleServers()) assert.False(t, DeploymentModeCluster.HasSingleServers()) assert.False(t, DeploymentModeSingle.HasAgents()) - assert.True(t, DeploymentModeResilientSingle.HasAgents()) + assert.True(t, DeploymentModeActiveFailover.HasAgents()) assert.True(t, DeploymentModeCluster.HasAgents()) assert.False(t, DeploymentModeSingle.HasDBServers()) - assert.False(t, DeploymentModeResilientSingle.HasDBServers()) + assert.False(t, DeploymentModeActiveFailover.HasDBServers()) assert.True(t, DeploymentModeCluster.HasDBServers()) assert.False(t, DeploymentModeSingle.HasCoordinators()) - assert.False(t, DeploymentModeResilientSingle.HasCoordinators()) + assert.False(t, DeploymentModeActiveFailover.HasCoordinators()) assert.True(t, DeploymentModeCluster.HasCoordinators()) } func TestDeploymentModeSupportsSync(t *testing.T) { assert.False(t, DeploymentModeSingle.SupportsSync()) - assert.False(t, DeploymentModeResilientSingle.SupportsSync()) + assert.False(t, DeploymentModeActiveFailover.SupportsSync()) assert.True(t, DeploymentModeCluster.SupportsSync()) } diff --git a/pkg/apis/deployment/v1alpha/server_group_spec.go b/pkg/apis/deployment/v1alpha/server_group_spec.go index f73bc3788..3e418f421 100644 --- a/pkg/apis/deployment/v1alpha/server_group_spec.go +++ b/pkg/apis/deployment/v1alpha/server_group_spec.go @@ -64,7 +64,7 @@ func (s ServerGroupSpec) Validate(group ServerGroup, used bool, mode DeploymentM if env == EnvironmentProduction { switch group { case ServerGroupSingle: - if mode == DeploymentModeResilientSingle { + if mode == DeploymentModeActiveFailover { minCount = 2 } case ServerGroupAgents: @@ -93,7 +93,7 @@ func (s *ServerGroupSpec) SetDefaults(group ServerGroup, used bool, mode Deploym if mode == DeploymentModeSingle { s.Count = util.NewInt(1) // Single server } else { - s.Count = util.NewInt(2) // Resilient single + s.Count = util.NewInt(2) // ActiveFailover } default: s.Count = util.NewInt(3) diff --git a/pkg/apis/deployment/v1alpha/server_group_spec_test.go b/pkg/apis/deployment/v1alpha/server_group_spec_test.go index 53134094e..f3fedbba8 100644 --- a/pkg/apis/deployment/v1alpha/server_group_spec_test.go +++ b/pkg/apis/deployment/v1alpha/server_group_spec_test.go @@ -35,14 +35,14 @@ func TestServerGroupSpecValidateCount(t *testing.T) { assert.Nil(t, ServerGroupSpec{Count: util.NewInt(0)}.Validate(ServerGroupSingle, false, DeploymentModeCluster, EnvironmentDevelopment)) assert.Nil(t, ServerGroupSpec{Count: util.NewInt(1)}.Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentDevelopment)) assert.Nil(t, ServerGroupSpec{Count: util.NewInt(3)}.Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewInt(1)}.Validate(ServerGroupAgents, true, DeploymentModeResilientSingle, EnvironmentDevelopment)) - assert.Nil(t, ServerGroupSpec{Count: util.NewInt(3)}.Validate(ServerGroupAgents, true, DeploymentModeResilientSingle, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewInt(1)}.Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentDevelopment)) + assert.Nil(t, ServerGroupSpec{Count: util.NewInt(3)}.Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentDevelopment)) assert.Nil(t, ServerGroupSpec{Count: util.NewInt(1)}.Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentDevelopment)) assert.Nil(t, ServerGroupSpec{Count: util.NewInt(6)}.Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentDevelopment)) assert.Nil(t, ServerGroupSpec{Count: util.NewInt(1)}.Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) assert.Nil(t, ServerGroupSpec{Count: util.NewInt(2)}.Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) assert.Nil(t, ServerGroupSpec{Count: util.NewInt(3)}.Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentProduction)) - assert.Nil(t, ServerGroupSpec{Count: util.NewInt(3)}.Validate(ServerGroupAgents, true, DeploymentModeResilientSingle, EnvironmentProduction)) + assert.Nil(t, ServerGroupSpec{Count: util.NewInt(3)}.Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentProduction)) assert.Nil(t, ServerGroupSpec{Count: util.NewInt(2)}.Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentProduction)) assert.Nil(t, ServerGroupSpec{Count: util.NewInt(2)}.Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentProduction)) assert.Nil(t, ServerGroupSpec{Count: util.NewInt(2)}.Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentProduction)) @@ -51,21 +51,21 @@ func TestServerGroupSpecValidateCount(t *testing.T) { // Invalid assert.Error(t, ServerGroupSpec{Count: util.NewInt(1)}.Validate(ServerGroupSingle, false, DeploymentModeCluster, EnvironmentDevelopment)) assert.Error(t, ServerGroupSpec{Count: util.NewInt(2)}.Validate(ServerGroupSingle, true, DeploymentModeSingle, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewInt(1)}.Validate(ServerGroupSingle, true, DeploymentModeResilientSingle, EnvironmentProduction)) + assert.Error(t, ServerGroupSpec{Count: util.NewInt(1)}.Validate(ServerGroupSingle, true, DeploymentModeActiveFailover, EnvironmentProduction)) assert.Error(t, ServerGroupSpec{Count: util.NewInt(0)}.Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewInt(0)}.Validate(ServerGroupAgents, true, DeploymentModeResilientSingle, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewInt(0)}.Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentDevelopment)) assert.Error(t, ServerGroupSpec{Count: util.NewInt(0)}.Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentDevelopment)) assert.Error(t, ServerGroupSpec{Count: util.NewInt(0)}.Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) assert.Error(t, ServerGroupSpec{Count: util.NewInt(0)}.Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) assert.Error(t, ServerGroupSpec{Count: util.NewInt(0)}.Validate(ServerGroupSyncWorkers, true, DeploymentModeCluster, EnvironmentDevelopment)) assert.Error(t, ServerGroupSpec{Count: util.NewInt(-1)}.Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentDevelopment)) - assert.Error(t, ServerGroupSpec{Count: util.NewInt(-1)}.Validate(ServerGroupAgents, true, DeploymentModeResilientSingle, EnvironmentDevelopment)) + assert.Error(t, ServerGroupSpec{Count: util.NewInt(-1)}.Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentDevelopment)) assert.Error(t, ServerGroupSpec{Count: util.NewInt(-1)}.Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentDevelopment)) assert.Error(t, ServerGroupSpec{Count: util.NewInt(-1)}.Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentDevelopment)) assert.Error(t, ServerGroupSpec{Count: util.NewInt(-1)}.Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentDevelopment)) assert.Error(t, ServerGroupSpec{Count: util.NewInt(-1)}.Validate(ServerGroupSyncWorkers, true, DeploymentModeCluster, EnvironmentDevelopment)) assert.Error(t, ServerGroupSpec{Count: util.NewInt(2)}.Validate(ServerGroupAgents, true, DeploymentModeCluster, EnvironmentProduction)) - assert.Error(t, ServerGroupSpec{Count: util.NewInt(2)}.Validate(ServerGroupAgents, true, DeploymentModeResilientSingle, EnvironmentProduction)) + assert.Error(t, ServerGroupSpec{Count: util.NewInt(2)}.Validate(ServerGroupAgents, true, DeploymentModeActiveFailover, EnvironmentProduction)) assert.Error(t, ServerGroupSpec{Count: util.NewInt(1)}.Validate(ServerGroupDBServers, true, DeploymentModeCluster, EnvironmentProduction)) assert.Error(t, ServerGroupSpec{Count: util.NewInt(1)}.Validate(ServerGroupCoordinators, true, DeploymentModeCluster, EnvironmentProduction)) assert.Error(t, ServerGroupSpec{Count: util.NewInt(1)}.Validate(ServerGroupSyncMasters, true, DeploymentModeCluster, EnvironmentProduction)) @@ -79,27 +79,27 @@ func TestServerGroupSpecDefault(t *testing.T) { } assert.Equal(t, 1, def(ServerGroupSpec{}, ServerGroupSingle, true, DeploymentModeSingle).GetCount()) - assert.Equal(t, 2, def(ServerGroupSpec{}, ServerGroupSingle, true, DeploymentModeResilientSingle).GetCount()) + assert.Equal(t, 2, def(ServerGroupSpec{}, ServerGroupSingle, true, DeploymentModeActiveFailover).GetCount()) assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSingle, false, DeploymentModeCluster).GetCount()) assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupAgents, false, DeploymentModeSingle).GetCount()) - assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupAgents, true, DeploymentModeResilientSingle).GetCount()) + assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupAgents, true, DeploymentModeActiveFailover).GetCount()) assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupAgents, true, DeploymentModeCluster).GetCount()) assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupDBServers, false, DeploymentModeSingle).GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupDBServers, false, DeploymentModeResilientSingle).GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupDBServers, false, DeploymentModeActiveFailover).GetCount()) assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupDBServers, true, DeploymentModeCluster).GetCount()) assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupCoordinators, false, DeploymentModeSingle).GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupCoordinators, false, DeploymentModeResilientSingle).GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupCoordinators, false, DeploymentModeActiveFailover).GetCount()) assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupCoordinators, true, DeploymentModeCluster).GetCount()) assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncMasters, false, DeploymentModeSingle).GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncMasters, false, DeploymentModeResilientSingle).GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncMasters, false, DeploymentModeActiveFailover).GetCount()) assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupSyncMasters, true, DeploymentModeCluster).GetCount()) assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncWorkers, false, DeploymentModeSingle).GetCount()) - assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncWorkers, false, DeploymentModeResilientSingle).GetCount()) + assert.Equal(t, 0, def(ServerGroupSpec{}, ServerGroupSyncWorkers, false, DeploymentModeActiveFailover).GetCount()) assert.Equal(t, 3, def(ServerGroupSpec{}, ServerGroupSyncWorkers, true, DeploymentModeCluster).GetCount()) for _, g := range AllServerGroups { diff --git a/pkg/apis/deployment/v1alpha/sync_spec_test.go b/pkg/apis/deployment/v1alpha/sync_spec_test.go index 567edf19c..a025382ce 100644 --- a/pkg/apis/deployment/v1alpha/sync_spec_test.go +++ b/pkg/apis/deployment/v1alpha/sync_spec_test.go @@ -35,16 +35,16 @@ func TestSyncSpecValidate(t *testing.T) { auth := AuthenticationSpec{JWTSecretName: util.NewString("foo")} tls := TLSSpec{CASecretName: util.NewString("None")} assert.Nil(t, SyncSpec{Image: util.NewString("foo"), Authentication: auth}.Validate(DeploymentModeSingle)) - assert.Nil(t, SyncSpec{Image: util.NewString("foo"), Authentication: auth}.Validate(DeploymentModeResilientSingle)) + assert.Nil(t, SyncSpec{Image: util.NewString("foo"), Authentication: auth}.Validate(DeploymentModeActiveFailover)) assert.Nil(t, SyncSpec{Image: util.NewString("foo"), Authentication: auth}.Validate(DeploymentModeCluster)) assert.Nil(t, SyncSpec{Image: util.NewString("foo"), Authentication: auth, TLS: tls, Enabled: util.NewBool(true)}.Validate(DeploymentModeCluster)) // Not valid assert.Error(t, SyncSpec{Image: util.NewString(""), Authentication: auth}.Validate(DeploymentModeSingle)) - assert.Error(t, SyncSpec{Image: util.NewString(""), Authentication: auth}.Validate(DeploymentModeResilientSingle)) + assert.Error(t, SyncSpec{Image: util.NewString(""), Authentication: auth}.Validate(DeploymentModeActiveFailover)) assert.Error(t, SyncSpec{Image: util.NewString(""), Authentication: auth}.Validate(DeploymentModeCluster)) assert.Error(t, SyncSpec{Image: util.NewString("foo"), Authentication: auth, TLS: tls, Enabled: util.NewBool(true)}.Validate(DeploymentModeSingle)) - assert.Error(t, SyncSpec{Image: util.NewString("foo"), Authentication: auth, TLS: tls, Enabled: util.NewBool(true)}.Validate(DeploymentModeResilientSingle)) + assert.Error(t, SyncSpec{Image: util.NewString("foo"), Authentication: auth, TLS: tls, Enabled: util.NewBool(true)}.Validate(DeploymentModeActiveFailover)) } func TestSyncSpecSetDefaults(t *testing.T) { diff --git a/pkg/deployment/reconcile/action_wait_for_member_up.go b/pkg/deployment/reconcile/action_wait_for_member_up.go index fb3462412..bfb6f0661 100644 --- a/pkg/deployment/reconcile/action_wait_for_member_up.go +++ b/pkg/deployment/reconcile/action_wait_for_member_up.go @@ -69,7 +69,7 @@ func (a *actionWaitForMemberUp) CheckProgress(ctx context.Context) (bool, error) switch a.actionCtx.GetMode() { case api.DeploymentModeSingle: return a.checkProgressSingle(ctx) - case api.DeploymentModeResilientSingle: + case api.DeploymentModeActiveFailover: if a.action.Group == api.ServerGroupAgents { return a.checkProgressAgent(ctx) } diff --git a/pkg/deployment/reconcile/plan_builder.go b/pkg/deployment/reconcile/plan_builder.go index 29cfd22e7..a3c51ff34 100644 --- a/pkg/deployment/reconcile/plan_builder.go +++ b/pkg/deployment/reconcile/plan_builder.go @@ -113,7 +113,7 @@ func createPlan(log zerolog.Logger, apiObject metav1.Object, switch spec.GetMode() { case api.DeploymentModeSingle: // Never scale down - case api.DeploymentModeResilientSingle: + case api.DeploymentModeActiveFailover: // Only scale singles plan = append(plan, createScalePlan(log, status.Members.Single, api.ServerGroupSingle, spec.Single.GetCount())...) case api.DeploymentModeCluster: diff --git a/pkg/deployment/reconcile/plan_builder_test.go b/pkg/deployment/reconcile/plan_builder_test.go index 20a7640bf..c43c5fdbe 100644 --- a/pkg/deployment/reconcile/plan_builder_test.go +++ b/pkg/deployment/reconcile/plan_builder_test.go @@ -86,14 +86,14 @@ func TestCreatePlanSingleScale(t *testing.T) { assert.Len(t, newPlan, 0) // Single mode does not scale } -// TestCreatePlanResilientSingleScale creates a `resilientsingle` deployment to test the creating of scaling plan. -func TestCreatePlanResilientSingleScale(t *testing.T) { +// TestCreatePlanActiveFailoverScale creates a `ActiveFailover` deployment to test the creating of scaling plan. +func TestCreatePlanActiveFailoverScale(t *testing.T) { getTLSKeyfile := func(group api.ServerGroup, member api.MemberStatus) (string, error) { return "", maskAny(fmt.Errorf("Not implemented")) } log := zerolog.Nop() spec := api.DeploymentSpec{ - Mode: api.NewMode(api.DeploymentModeResilientSingle), + Mode: api.NewMode(api.DeploymentModeActiveFailover), } spec.SetDefaults("test") spec.Single.Count = util.NewInt(2) diff --git a/pkg/deployment/resources/pod_creator.go b/pkg/deployment/resources/pod_creator.go index 8c3a2a44d..0392090f2 100644 --- a/pkg/deployment/resources/pod_creator.go +++ b/pkg/deployment/resources/pod_creator.go @@ -185,7 +185,7 @@ func createArangodArgs(apiObject metav1.Object, deplSpec api.DeploymentSpec, gro optionPair{"--foxx.queues", "true"}, optionPair{"--server.statistics", "true"}, ) - if deplSpec.GetMode() == api.DeploymentModeResilientSingle { + if deplSpec.GetMode() == api.DeploymentModeActiveFailover { addAgentEndpoints = true options = append(options, optionPair{"--replication.automatic-failover", "true"}, diff --git a/pkg/deployment/resources/pod_creator_single_args_test.go b/pkg/deployment/resources/pod_creator_single_args_test.go index 9916f394b..6920481cb 100644 --- a/pkg/deployment/resources/pod_creator_single_args_test.go +++ b/pkg/deployment/resources/pod_creator_single_args_test.go @@ -202,7 +202,7 @@ func TestCreateArangodArgsSingle(t *testing.T) { ) } - // Resilient single + // ActiveFailover { apiObject := &api.ArangoDeployment{ ObjectMeta: metav1.ObjectMeta{ @@ -210,7 +210,7 @@ func TestCreateArangodArgsSingle(t *testing.T) { Namespace: "ns", }, Spec: api.DeploymentSpec{ - Mode: api.NewMode(api.DeploymentModeResilientSingle), + Mode: api.NewMode(api.DeploymentModeActiveFailover), }, } apiObject.Spec.SetDefaults("test") diff --git a/tests/cursor_test.go b/tests/cursor_test.go index 036f30a49..15b7dc7dc 100644 --- a/tests/cursor_test.go +++ b/tests/cursor_test.go @@ -83,9 +83,9 @@ func TestCursorSingle(t *testing.T) { removeDeployment(c, depl.GetName(), ns) } -// TestCursorResilientSingle tests the creating of a resilientsingle server deployment +// TestCursorActiveFailover tests the creating of a ActiveFailover server deployment // with default settings. -func TestCursorResilientSingle(t *testing.T) { +func TestCursorActiveFailover(t *testing.T) { longOrSkip(t) c := client.MustNewInCluster() kubecli := mustNewKubeClient(t) @@ -93,7 +93,7 @@ func TestCursorResilientSingle(t *testing.T) { // Prepare deployment config depl := newDeployment("test-cur-rs-" + uniuri.NewLen(4)) - depl.Spec.Mode = api.NewMode(api.DeploymentModeResilientSingle) + depl.Spec.Mode = api.NewMode(api.DeploymentModeActiveFailover) // Create deployment _, err := c.DatabaseV1alpha().ArangoDeployments(ns).Create(depl) @@ -114,7 +114,7 @@ func TestCursorResilientSingle(t *testing.T) { // Wait for single server available if err := waitUntilVersionUp(client, nil); err != nil { - t.Fatalf("ResilientSingle servers not running returning version in time: %v", err) + t.Fatalf("ActiveFailover servers not running returning version in time: %v", err) } // Check server role diff --git a/tests/deployments_test.go b/tests/deployments_test.go index cc945c5bc..b3c97e750 100644 --- a/tests/deployments_test.go +++ b/tests/deployments_test.go @@ -46,14 +46,14 @@ func TestDeploymentSingleRocksDB(t *testing.T) { deploymentSubTest(t, api.DeploymentModeSingle, api.StorageEngineRocksDB) } -// test deployment resilient single server mmfiles -func TestDeploymentResilientSingleMMFiles(t *testing.T) { - deploymentSubTest(t, api.DeploymentModeResilientSingle, api.StorageEngineMMFiles) +// test deployment active-failover server mmfiles +func TestDeploymentActiveFailoverMMFiles(t *testing.T) { + deploymentSubTest(t, api.DeploymentModeActiveFailover, api.StorageEngineMMFiles) } -// test deployment resilient single server rocksdb -func TestDeploymentResilientSingleRocksDB(t *testing.T) { - deploymentSubTest(t, api.DeploymentModeResilientSingle, api.StorageEngineRocksDB) +// test deployment active-failover server rocksdb +func TestDeploymentActiveFailoverRocksDB(t *testing.T) { + deploymentSubTest(t, api.DeploymentModeActiveFailover, api.StorageEngineRocksDB) } // test deployment cluster mmfiles diff --git a/tests/simple_test.go b/tests/simple_test.go index 060cca7d1..90427aa41 100644 --- a/tests/simple_test.go +++ b/tests/simple_test.go @@ -75,16 +75,16 @@ func TestSimpleSingle(t *testing.T) { assert.Equal(t, driver.ServerRoleSingle, role) } -// TestSimpleResilientSingle tests the creating of a resilientsingle server deployment +// TestSimpleActiveFailover tests the creating of a ActiveFailover server deployment // with default settings. -func TestSimpleResilientSingle(t *testing.T) { +func TestSimpleActiveFailover(t *testing.T) { c := client.MustNewInCluster() kubecli := mustNewKubeClient(t) ns := getNamespace(t) // Prepare deployment config depl := newDeployment("test-rs-" + uniuri.NewLen(4)) - depl.Spec.Mode = api.NewMode(api.DeploymentModeResilientSingle) + depl.Spec.Mode = api.NewMode(api.DeploymentModeActiveFailover) // Create deployment _, err := c.DatabaseV1alpha().ArangoDeployments(ns).Create(depl) @@ -106,7 +106,7 @@ func TestSimpleResilientSingle(t *testing.T) { // Wait for single server available if err := waitUntilVersionUp(client, nil); err != nil { - t.Fatalf("ResilientSingle servers not running returning version in time: %v", err) + t.Fatalf("ActiveFailover servers not running returning version in time: %v", err) } // Check server role diff --git a/tests/test_util.go b/tests/test_util.go index f13c262c8..e04907023 100644 --- a/tests/test_util.go +++ b/tests/test_util.go @@ -353,7 +353,7 @@ func waitUntilArangoDeploymentHealthy(deployment *api.ArangoDeployment, DBClient if err := waitUntilVersionUp(DBClient, checkVersionPredicate); err != nil { return maskAny(fmt.Errorf("Single Server not running in time: %s", err)) } - case api.DeploymentModeResilientSingle: + case api.DeploymentModeActiveFailover: if err := waitUntilVersionUp(DBClient, checkVersionPredicate); err != nil { return maskAny(fmt.Errorf("Single Server not running in time: %s", err)) } diff --git a/tests/upgrade_test.go b/tests/upgrade_test.go index 660397ee8..f97152fe3 100644 --- a/tests/upgrade_test.go +++ b/tests/upgrade_test.go @@ -44,14 +44,14 @@ func TestUpgradeSingleMMFiles32to33(t *testing.T) { // upgradeSubTest(t, api.DeploymentModeSingle, api.StorageEngineRocksDB, "3.3.4", "3.4.0") // } -/*// test upgrade resilient single server rocksdb 3.3 -> 3.4 -func TestUpgradeResilientSingleRocksDB33to34(t *testing.T) { - upgradeSubTest(t, api.DeploymentModeResilientSingle, api.StorageEngineRocksDB, "3.3.5", "3.4.0") +/*// test upgrade active-failover server rocksdb 3.3 -> 3.4 +func TestUpgradeActiveFailoverRocksDB33to34(t *testing.T) { + upgradeSubTest(t, api.DeploymentModeActiveFailover, api.StorageEngineRocksDB, "3.3.5", "3.4.0") }*/ -// // test upgrade resilient single server mmfiles 3.3 -> 3.4 -// func TestUpgradeResilientSingleMMFiles33to34(t *testing.T) { -// upgradeSubTest(t, api.DeploymentModeResilientSingle, api.StorageEngineMMFiles, "3.3.0", "3.4.0") +// // test upgrade active-failover server mmfiles 3.3 -> 3.4 +// func TestUpgradeActiveFailoverMMFiles33to34(t *testing.T) { +// upgradeSubTest(t, api.DeploymentModeActiveFailover, api.StorageEngineMMFiles, "3.3.0", "3.4.0") // } // test upgrade cluster rocksdb 3.2 -> 3.3 @@ -69,9 +69,9 @@ func TestDowngradeSingleMMFiles333to332(t *testing.T) { upgradeSubTest(t, api.DeploymentModeSingle, api.StorageEngineMMFiles, "3.3.3", "3.3.2") } -// test downgrade resilient single server rocksdb 3.3.3 -> 3.3.2 -func TestDowngradeResilientSingleRocksDB333to332(t *testing.T) { - upgradeSubTest(t, api.DeploymentModeResilientSingle, api.StorageEngineRocksDB, "3.3.3", "3.3.2") +// test downgrade ActiveFailover server rocksdb 3.3.3 -> 3.3.2 +func TestDowngradeActiveFailoverRocksDB333to332(t *testing.T) { + upgradeSubTest(t, api.DeploymentModeActiveFailover, api.StorageEngineRocksDB, "3.3.3", "3.3.2") } // test downgrade cluster rocksdb 3.3.3 -> 3.3.2