Skip to content

Commit

Permalink
Merge pull request #8636 from GuptaManan100/naming-vtorc-config
Browse files Browse the repository at this point in the history
Fixing vtorc naming convention - Configuration, API and CLI
  • Loading branch information
deepthi authored Aug 19, 2021
2 parents 6e7d7d2 + e9ef83d commit e2ef3f0
Show file tree
Hide file tree
Showing 18 changed files with 580 additions and 813 deletions.
2 changes: 1 addition & 1 deletion go/test/endtoend/vtorc/test_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"MySQLReplicaPassword": "",
"RecoveryPeriodBlockSeconds": 1,
"InstancePollSeconds": 1,
"PreventCrossDataCenterMasterFailover": true
"PreventCrossDataCenterPrimaryFailover": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"DurabilityParams": {
"zone2-0000000200": "prefer"
},
"PreventCrossDataCenterMasterFailover": true
"PreventCrossDataCenterPrimaryFailover": true
}
2 changes: 1 addition & 1 deletion go/test/endtoend/vtorc/test_config_promotion_failure.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"RecoveryPeriodBlockSeconds": 1,
"InstancePollSeconds": 1,
"ReplicationLagQuery": "select 61",
"FailMasterPromotionOnLagMinutes": 1
"FailPrimaryPromotionOnLagMinutes": 1
}
2 changes: 1 addition & 1 deletion go/test/endtoend/vtorc/test_config_promotion_success.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"RecoveryPeriodBlockSeconds": 1,
"InstancePollSeconds": 1,
"ReplicationLagQuery": "select 59",
"FailMasterPromotionOnLagMinutes": 1
"FailPrimaryPromotionOnLagMinutes": 1
}
83 changes: 31 additions & 52 deletions go/vt/orchestrator/app/cli.go

Large diffs are not rendered by default.

232 changes: 116 additions & 116 deletions go/vt/orchestrator/app/command_help.go

Large diffs are not rendered by default.

692 changes: 327 additions & 365 deletions go/vt/orchestrator/config/config.go

Large diffs are not rendered by default.

104 changes: 0 additions & 104 deletions go/vt/orchestrator/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,110 +12,6 @@ func init() {
log.SetLevel(log.ERROR)
}

func TestReplicationLagQuery(t *testing.T) {
{
c := newConfiguration()
c.SlaveLagQuery = "select 3"
c.ReplicationLagQuery = "select 4"
err := c.postReadAdjustments()
test.S(t).ExpectNotNil(err)
}
{
c := newConfiguration()
c.SlaveLagQuery = "select 3"
c.ReplicationLagQuery = "select 3"
err := c.postReadAdjustments()
test.S(t).ExpectNil(err)
}
{
c := newConfiguration()
c.SlaveLagQuery = "select 3"
c.ReplicationLagQuery = ""
err := c.postReadAdjustments()
test.S(t).ExpectNil(err)
test.S(t).ExpectEquals(c.ReplicationLagQuery, "select 3")
}
}

func TestPostponeReplicaRecoveryOnLagMinutes(t *testing.T) {
{
c := newConfiguration()
c.PostponeSlaveRecoveryOnLagMinutes = 3
c.PostponeReplicaRecoveryOnLagMinutes = 5
err := c.postReadAdjustments()
test.S(t).ExpectNotNil(err)
}
{
c := newConfiguration()
c.PostponeSlaveRecoveryOnLagMinutes = 3
c.PostponeReplicaRecoveryOnLagMinutes = 3
err := c.postReadAdjustments()
test.S(t).ExpectNil(err)
}
{
c := newConfiguration()
c.PostponeSlaveRecoveryOnLagMinutes = 3
c.PostponeReplicaRecoveryOnLagMinutes = 0
err := c.postReadAdjustments()
test.S(t).ExpectNil(err)
test.S(t).ExpectEquals(c.PostponeReplicaRecoveryOnLagMinutes, uint(3))
}
}

func TestMasterFailoverDetachReplicaMasterHost(t *testing.T) {
{
c := newConfiguration()
c.MasterFailoverDetachSlaveMasterHost = false
c.MasterFailoverDetachReplicaMasterHost = false
err := c.postReadAdjustments()
test.S(t).ExpectNil(err)
test.S(t).ExpectFalse(c.MasterFailoverDetachReplicaMasterHost)
}
{
c := newConfiguration()
c.MasterFailoverDetachSlaveMasterHost = false
c.MasterFailoverDetachReplicaMasterHost = true
err := c.postReadAdjustments()
test.S(t).ExpectNil(err)
test.S(t).ExpectTrue(c.MasterFailoverDetachReplicaMasterHost)
}
{
c := newConfiguration()
c.MasterFailoverDetachSlaveMasterHost = true
c.MasterFailoverDetachReplicaMasterHost = false
err := c.postReadAdjustments()
test.S(t).ExpectNil(err)
test.S(t).ExpectTrue(c.MasterFailoverDetachReplicaMasterHost)
}
}

func TestMasterFailoverDetachDetachLostReplicasAfterMasterFailover(t *testing.T) {
{
c := newConfiguration()
c.DetachLostSlavesAfterMasterFailover = false
c.DetachLostReplicasAfterMasterFailover = false
err := c.postReadAdjustments()
test.S(t).ExpectNil(err)
test.S(t).ExpectFalse(c.DetachLostReplicasAfterMasterFailover)
}
{
c := newConfiguration()
c.DetachLostSlavesAfterMasterFailover = false
c.DetachLostReplicasAfterMasterFailover = true
err := c.postReadAdjustments()
test.S(t).ExpectNil(err)
test.S(t).ExpectTrue(c.DetachLostReplicasAfterMasterFailover)
}
{
c := newConfiguration()
c.DetachLostSlavesAfterMasterFailover = true
c.DetachLostReplicasAfterMasterFailover = false
err := c.postReadAdjustments()
test.S(t).ExpectNil(err)
test.S(t).ExpectTrue(c.DetachLostReplicasAfterMasterFailover)
}
}

func TestRecoveryPeriodBlock(t *testing.T) {
{
c := newConfiguration()
Expand Down
121 changes: 43 additions & 78 deletions go/vt/orchestrator/http/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,6 @@ const (
OK
)

var apiSynonyms = map[string]string{
"relocate-slaves": "relocate-replicas",
"regroup-slaves": "regroup-replicas",
"move-up-slaves": "move-up-replicas",
"repoint-slaves": "repoint-replicas",
"enslave-siblings": "take-siblings",
"enslave-master": "take-master",
"regroup-slaves-bls": "regroup-replicas-bls",
"move-slaves-gtid": "move-replicas-gtid",
"regroup-slaves-gtid": "regroup-replicas-gtid",
"detach-slave": "detach-replica",
"reattach-slave": "reattach-replica",
"detach-slave-master-host": "detach-replica-master-host",
"reattach-slave-master-host": "reattach-replica-master-host",
"cluster-osc-slaves": "cluster-osc-replicas",
"start-slave": "start-replica",
"restart-slave": "restart-replica",
"stop-slave": "stop-replica",
"stop-slave-nice": "stop-replica-nice",
"reset-slave": "reset-replica",
"restart-slave-statements": "restart-replica-statements",
}

var registeredPaths = []string{}
var emptyInstanceKey inst.InstanceKey

Expand Down Expand Up @@ -642,7 +619,7 @@ func (this *HttpAPI) DetachReplicaPrimaryHost(params martini.Params, r render.Re
Respond(r, &APIResponse{Code: OK, Message: fmt.Sprintf("Replica detached: %+v", instance.Key), Details: instance})
}

// ReattachReplicaPrimaryHost reverts a detachReplicaMasterHost command
// ReattachReplicaPrimaryHost reverts a detachReplicaPrimaryHost command
// by resetting the original primary hostname in CHANGE MASTER TO
func (this *HttpAPI) ReattachReplicaPrimaryHost(params martini.Params, r render.Render, req *http.Request, user auth.User) {
if !isAuthorizedForAction(req, user) {
Expand Down Expand Up @@ -2323,10 +2300,10 @@ func (this *HttpAPI) gracefulPrimaryTakeover(params martini.Params, r render.Ren
return
}
if topologyRecovery == nil || topologyRecovery.SuccessorKey == nil {
Respond(r, &APIResponse{Code: ERROR, Message: "graceful-master-takeover: no successor promoted", Details: topologyRecovery})
Respond(r, &APIResponse{Code: ERROR, Message: "graceful-primary-takeover: no successor promoted", Details: topologyRecovery})
return
}
Respond(r, &APIResponse{Code: OK, Message: "graceful-master-takeover: successor promoted", Details: topologyRecovery})
Respond(r, &APIResponse{Code: OK, Message: "graceful-primary-takeover: successor promoted", Details: topologyRecovery})
}

// GracefulPrimaryTakeover gracefully fails over a primary, either:
Expand Down Expand Up @@ -2434,8 +2411,8 @@ func (this *HttpAPI) RegisterCandidate(params martini.Params, r render.Render, r
// AutomatedRecoveryFilters retuens list of clusters which are configured with automated recovery
func (this *HttpAPI) AutomatedRecoveryFilters(params martini.Params, r render.Render, req *http.Request) {
automatedRecoveryMap := make(map[string]interface{})
automatedRecoveryMap["RecoverMasterClusterFilters"] = config.Config.RecoverMasterClusterFilters
automatedRecoveryMap["RecoverIntermediateMasterClusterFilters"] = config.Config.RecoverIntermediateMasterClusterFilters
automatedRecoveryMap["RecoverMasterClusterFilters"] = config.Config.RecoverPrimaryClusterFilters
automatedRecoveryMap["RecoverIntermediateMasterClusterFilters"] = config.Config.RecoverIntermediatePrimaryClusterFilters
automatedRecoveryMap["RecoveryIgnoreHostnameFilters"] = config.Config.RecoveryIgnoreHostnameFilters

Respond(r, &APIResponse{Code: OK, Message: "Automated recovery configuration details", Details: automatedRecoveryMap})
Expand Down Expand Up @@ -2794,14 +2771,6 @@ func (this *HttpAPI) CheckGlobalRecoveries(params martini.Params, r render.Rende
Respond(r, &APIResponse{Code: OK, Message: fmt.Sprintf("Global recoveries %+v", details), Details: details})
}

func (this *HttpAPI) getSynonymPath(path string) (synonymPath string) {
pathBase := strings.Split(path, "/")[0]
if synonym, ok := apiSynonyms[pathBase]; ok {
synonymPath = fmt.Sprintf("%s%s", synonym, path[len(pathBase):])
}
return synonymPath
}

func (this *HttpAPI) registerSingleAPIRequest(m *martini.ClassicMartini, path string, handler martini.Handler, allowProxy bool) {
registeredPaths = append(registeredPaths, path)
fullPath := fmt.Sprintf("%s/api/%s", this.URLPrefix, path)
Expand All @@ -2811,10 +2780,6 @@ func (this *HttpAPI) registerSingleAPIRequest(m *martini.ClassicMartini, path st

func (this *HttpAPI) registerAPIRequestInternal(m *martini.ClassicMartini, path string, handler martini.Handler, allowProxy bool) {
this.registerSingleAPIRequest(m, path, handler, allowProxy)

if synonym := this.getSynonymPath(path); synonym != "" {
this.registerSingleAPIRequest(m, synonym, handler, allowProxy)
}
}

func (this *HttpAPI) registerAPIRequest(m *martini.ClassicMartini, path string, handler martini.Handler) {
Expand All @@ -2830,46 +2795,46 @@ func (this *HttpAPI) RegisterRequests(m *martini.ClassicMartini) {
// Smart relocation:
this.registerAPIRequest(m, "relocate/:host/:port/:belowHost/:belowPort", this.RelocateBelow)
this.registerAPIRequest(m, "relocate-below/:host/:port/:belowHost/:belowPort", this.RelocateBelow)
this.registerAPIRequest(m, "relocate-slaves/:host/:port/:belowHost/:belowPort", this.RelocateReplicas)
this.registerAPIRequest(m, "regroup-slaves/:host/:port", this.RegroupReplicas)
this.registerAPIRequest(m, "relocate-replicas/:host/:port/:belowHost/:belowPort", this.RelocateReplicas)
this.registerAPIRequest(m, "regroup-replicas/:host/:port", this.RegroupReplicas)

// Classic file:pos relocation:
this.registerAPIRequest(m, "move-up/:host/:port", this.MoveUp)
this.registerAPIRequest(m, "move-up-slaves/:host/:port", this.MoveUpReplicas)
this.registerAPIRequest(m, "move-up-replicas/:host/:port", this.MoveUpReplicas)
this.registerAPIRequest(m, "move-below/:host/:port/:siblingHost/:siblingPort", this.MoveBelow)
this.registerAPIRequest(m, "repoint/:host/:port/:belowHost/:belowPort", this.Repoint)
this.registerAPIRequest(m, "repoint-slaves/:host/:port", this.RepointReplicas)
this.registerAPIRequest(m, "make-co-master/:host/:port", this.MakeCoPrimary)
this.registerAPIRequest(m, "enslave-siblings/:host/:port", this.TakeSiblings)
this.registerAPIRequest(m, "enslave-master/:host/:port", this.TakePrimary)
this.registerAPIRequest(m, "repoint-replicas/:host/:port", this.RepointReplicas)
this.registerAPIRequest(m, "make-co-primary/:host/:port", this.MakeCoPrimary)
this.registerAPIRequest(m, "take-siblings/:host/:port", this.TakeSiblings)
this.registerAPIRequest(m, "take-primary/:host/:port", this.TakePrimary)

// Binlog server relocation:
this.registerAPIRequest(m, "regroup-slaves-bls/:host/:port", this.RegroupReplicasBinlogServers)
this.registerAPIRequest(m, "regroup-replicas-bls/:host/:port", this.RegroupReplicasBinlogServers)

// GTID relocation:
this.registerAPIRequest(m, "move-below-gtid/:host/:port/:belowHost/:belowPort", this.MoveBelowGTID)
this.registerAPIRequest(m, "move-slaves-gtid/:host/:port/:belowHost/:belowPort", this.MoveReplicasGTID)
this.registerAPIRequest(m, "regroup-slaves-gtid/:host/:port", this.RegroupReplicasGTID)
this.registerAPIRequest(m, "move-replicas-gtid/:host/:port/:belowHost/:belowPort", this.MoveReplicasGTID)
this.registerAPIRequest(m, "regroup-replicas-gtid/:host/:port", this.RegroupReplicasGTID)

// Replication, general:
this.registerAPIRequest(m, "enable-gtid/:host/:port", this.EnableGTID)
this.registerAPIRequest(m, "disable-gtid/:host/:port", this.DisableGTID)
this.registerAPIRequest(m, "locate-gtid-errant/:host/:port", this.LocateErrantGTID)
this.registerAPIRequest(m, "gtid-errant-reset-master/:host/:port", this.ErrantGTIDResetPrimary)
this.registerAPIRequest(m, "gtid-errant-reset-primary/:host/:port", this.ErrantGTIDResetPrimary)
this.registerAPIRequest(m, "gtid-errant-inject-empty/:host/:port", this.ErrantGTIDInjectEmpty)
this.registerAPIRequest(m, "skip-query/:host/:port", this.SkipQuery)
this.registerAPIRequest(m, "start-slave/:host/:port", this.StartReplication)
this.registerAPIRequest(m, "restart-slave/:host/:port", this.RestartReplication)
this.registerAPIRequest(m, "stop-slave/:host/:port", this.StopReplication)
this.registerAPIRequest(m, "stop-slave-nice/:host/:port", this.StopReplicationNicely)
this.registerAPIRequest(m, "reset-slave/:host/:port", this.ResetReplication)
this.registerAPIRequest(m, "detach-slave/:host/:port", this.DetachReplicaPrimaryHost)
this.registerAPIRequest(m, "reattach-slave/:host/:port", this.ReattachReplicaPrimaryHost)
this.registerAPIRequest(m, "detach-slave-master-host/:host/:port", this.DetachReplicaPrimaryHost)
this.registerAPIRequest(m, "reattach-slave-master-host/:host/:port", this.ReattachReplicaPrimaryHost)
this.registerAPIRequest(m, "start-replica/:host/:port", this.StartReplication)
this.registerAPIRequest(m, "restart-replica/:host/:port", this.RestartReplication)
this.registerAPIRequest(m, "stop-replica/:host/:port", this.StopReplication)
this.registerAPIRequest(m, "stop-replica-nice/:host/:port", this.StopReplicationNicely)
this.registerAPIRequest(m, "reset-replica/:host/:port", this.ResetReplication)
this.registerAPIRequest(m, "detach-replica/:host/:port", this.DetachReplicaPrimaryHost)
this.registerAPIRequest(m, "reattach-replica/:host/:port", this.ReattachReplicaPrimaryHost)
this.registerAPIRequest(m, "detach-replica-primary-host/:host/:port", this.DetachReplicaPrimaryHost)
this.registerAPIRequest(m, "reattach-replica-primary-host/:host/:port", this.ReattachReplicaPrimaryHost)
this.registerAPIRequest(m, "flush-binary-logs/:host/:port", this.FlushBinaryLogs)
this.registerAPIRequest(m, "purge-binary-logs/:host/:port/:logFile", this.PurgeBinaryLogs)
this.registerAPIRequest(m, "restart-slave-statements/:host/:port", this.RestartReplicationStatements)
this.registerAPIRequest(m, "restart-replica-statements/:host/:port", this.RestartReplicationStatements)

// Replication information:
this.registerAPIRequest(m, "can-replicate-from/:host/:port/:belowHost/:belowPort", this.CanReplicateFrom)
Expand Down Expand Up @@ -2899,13 +2864,13 @@ func (this *HttpAPI) RegisterRequests(m *martini.ClassicMartini) {
this.registerAPIRequest(m, "cluster/instance/:host/:port", this.ClusterByInstance)
this.registerAPIRequest(m, "cluster-info/:clusterHint", this.ClusterInfo)
this.registerAPIRequest(m, "cluster-info/alias/:clusterAlias", this.ClusterInfoByAlias)
this.registerAPIRequest(m, "cluster-osc-slaves/:clusterHint", this.ClusterOSCReplicas)
this.registerAPIRequest(m, "cluster-osc-replicas/:clusterHint", this.ClusterOSCReplicas)
this.registerAPIRequest(m, "set-cluster-alias/:clusterName", this.SetClusterAliasManualOverride)
this.registerAPIRequest(m, "clusters", this.Clusters)
this.registerAPIRequest(m, "clusters-info", this.ClustersInfo)

this.registerAPIRequest(m, "masters", this.Primaries)
this.registerAPIRequest(m, "master/:clusterHint", this.ClusterPrimary)
this.registerAPIRequest(m, "primaries", this.Primaries)
this.registerAPIRequest(m, "primary/:clusterHint", this.ClusterPrimary)
this.registerAPIRequest(m, "instance-replicas/:host/:port", this.InstanceReplicas)
this.registerAPIRequest(m, "all-instances", this.AllInstances)
this.registerAPIRequest(m, "downtimed", this.Downtimed)
Expand All @@ -2919,8 +2884,8 @@ func (this *HttpAPI) RegisterRequests(m *martini.ClassicMartini) {
this.registerAPIRequest(m, "snapshot-topologies", this.SnapshotTopologies)

// Key-value:
this.registerAPIRequest(m, "submit-masters-to-kv-stores", this.SubmitPrimariesToKvStores)
this.registerAPIRequest(m, "submit-masters-to-kv-stores/:clusterHint", this.SubmitPrimariesToKvStores)
this.registerAPIRequest(m, "submit-primaries-to-kv-stores", this.SubmitPrimariesToKvStores)
this.registerAPIRequest(m, "submit-primaries-to-kv-stores/:clusterHint", this.SubmitPrimariesToKvStores)

// Tags:
this.registerAPIRequest(m, "tagged", this.Tagged)
Expand Down Expand Up @@ -2958,18 +2923,18 @@ func (this *HttpAPI) RegisterRequests(m *martini.ClassicMartini) {
this.registerAPIRequest(m, "recover/:host/:port/:candidateHost/:candidatePort", this.Recover)
this.registerAPIRequest(m, "recover-lite/:host/:port", this.RecoverLite)
this.registerAPIRequest(m, "recover-lite/:host/:port/:candidateHost/:candidatePort", this.RecoverLite)
this.registerAPIRequest(m, "graceful-master-takeover/:host/:port", this.GracefulPrimaryTakeover)
this.registerAPIRequest(m, "graceful-master-takeover/:host/:port/:designatedHost/:designatedPort", this.GracefulPrimaryTakeover)
this.registerAPIRequest(m, "graceful-master-takeover/:clusterHint", this.GracefulPrimaryTakeover)
this.registerAPIRequest(m, "graceful-master-takeover/:clusterHint/:designatedHost/:designatedPort", this.GracefulPrimaryTakeover)
this.registerAPIRequest(m, "graceful-master-takeover-auto/:host/:port", this.GracefulPrimaryTakeoverAuto)
this.registerAPIRequest(m, "graceful-master-takeover-auto/:host/:port/:designatedHost/:designatedPort", this.GracefulPrimaryTakeoverAuto)
this.registerAPIRequest(m, "graceful-master-takeover-auto/:clusterHint", this.GracefulPrimaryTakeoverAuto)
this.registerAPIRequest(m, "graceful-master-takeover-auto/:clusterHint/:designatedHost/:designatedPort", this.GracefulPrimaryTakeoverAuto)
this.registerAPIRequest(m, "force-master-failover/:host/:port", this.ForcePrimaryFailover)
this.registerAPIRequest(m, "force-master-failover/:clusterHint", this.ForcePrimaryFailover)
this.registerAPIRequest(m, "force-master-takeover/:clusterHint/:designatedHost/:designatedPort", this.ForcePrimaryTakeover)
this.registerAPIRequest(m, "force-master-takeover/:host/:port/:designatedHost/:designatedPort", this.ForcePrimaryTakeover)
this.registerAPIRequest(m, "graceful-primary-takeover/:host/:port", this.GracefulPrimaryTakeover)
this.registerAPIRequest(m, "graceful-primary-takeover/:host/:port/:designatedHost/:designatedPort", this.GracefulPrimaryTakeover)
this.registerAPIRequest(m, "graceful-primary-takeover/:clusterHint", this.GracefulPrimaryTakeover)
this.registerAPIRequest(m, "graceful-primary-takeover/:clusterHint/:designatedHost/:designatedPort", this.GracefulPrimaryTakeover)
this.registerAPIRequest(m, "graceful-primary-takeover-auto/:host/:port", this.GracefulPrimaryTakeoverAuto)
this.registerAPIRequest(m, "graceful-primary-takeover-auto/:host/:port/:designatedHost/:designatedPort", this.GracefulPrimaryTakeoverAuto)
this.registerAPIRequest(m, "graceful-primary-takeover-auto/:clusterHint", this.GracefulPrimaryTakeoverAuto)
this.registerAPIRequest(m, "graceful-primary-takeover-auto/:clusterHint/:designatedHost/:designatedPort", this.GracefulPrimaryTakeoverAuto)
this.registerAPIRequest(m, "force-primary-failover/:host/:port", this.ForcePrimaryFailover)
this.registerAPIRequest(m, "force-primary-failover/:clusterHint", this.ForcePrimaryFailover)
this.registerAPIRequest(m, "force-primary-takeover/:clusterHint/:designatedHost/:designatedPort", this.ForcePrimaryTakeover)
this.registerAPIRequest(m, "force-primary-takeover/:host/:port/:designatedHost/:designatedPort", this.ForcePrimaryTakeover)
this.registerAPIRequest(m, "register-candidate/:host/:port/:promotionRule", this.RegisterCandidate)
this.registerAPIRequest(m, "automated-recovery-filters", this.AutomatedRecoveryFilters)
this.registerAPIRequest(m, "audit-failure-detection", this.AuditFailureDetection)
Expand Down
22 changes: 1 addition & 21 deletions go/vt/orchestrator/http/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,6 @@ func init() {
log.SetLevel(log.ERROR)
}

func TestGetSynonymPath(t *testing.T) {
api := HttpAPI{}

{
path := "relocate-slaves"
synonym := api.getSynonymPath(path)
test.S(t).ExpectEquals(synonym, "relocate-replicas")
}
{
path := "relocate-slaves/:host/:port"
synonym := api.getSynonymPath(path)
test.S(t).ExpectEquals(synonym, "relocate-replicas/:host/:port")
}
}

func TestKnownPaths(t *testing.T) {
m := martini.Classic()
api := HttpAPI{}
Expand All @@ -46,10 +31,5 @@ func TestKnownPaths(t *testing.T) {
test.S(t).ExpectTrue(pathsMap["health"])
test.S(t).ExpectTrue(pathsMap["lb-check"])
test.S(t).ExpectTrue(pathsMap["relocate"])
test.S(t).ExpectTrue(pathsMap["relocate-slaves"])

for path, synonym := range apiSynonyms {
test.S(t).ExpectTrue(pathsMap[path])
test.S(t).ExpectTrue(pathsMap[synonym])
}
test.S(t).ExpectTrue(pathsMap["relocate-replicas"])
}
Loading

0 comments on commit e2ef3f0

Please sign in to comment.