Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete pre-EPM code and fix unit tests #1679

Merged
merged 8 commits into from
May 11, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go/cmd/vtcombo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func main() {
topodatapb.TabletType_REPLICA,
topodatapb.TabletType_RDONLY,
}
vtgate.Init(context.Background(), healthCheck, ts, resilientSrvTopoServer, cell, 1*time.Millisecond /*retryDelay*/, 2 /*retryCount*/, 30*time.Second /*connTimeoutTotal*/, 10*time.Second /*connTimeoutPerConn*/, 365*24*time.Hour /*connLife*/, tabletTypesToWait, 0 /*maxInFlight*/, "" /*testGateway*/)
vtgate.Init(context.Background(), healthCheck, ts, resilientSrvTopoServer, cell, 2 /*retryCount*/, tabletTypesToWait, 0 /*maxInFlight*/)

// vtctld configuration and init
vtctld.InitVtctld(ts)
Expand Down
10 changes: 10 additions & 0 deletions go/cmd/vtcombo/tablet_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,16 @@ func initTabletMap(ts topo.Server, topology string, mysqld mysqlctl.MysqlDaemon,
return &internalTabletManagerClient{}
})
*tmclient.TabletManagerProtocol = "internal"

// run healthcheck on all vttablets
tmc := tmclient.NewTabletManagerClient()
for _, tablet := range tabletMap {
tabletInfo, err := ts.GetTablet(ctx, tablet.agent.TabletAlias)
if err != nil {
log.Fatalf("cannot find tablet: %+v", tablet.agent.TabletAlias)
}
tmc.RunHealthCheck(ctx, tabletInfo)
}
}

//
Expand Down
22 changes: 9 additions & 13 deletions go/cmd/vtgate/vtgate.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,13 @@ import (
)

var (
cell = flag.String("cell", "test_nj", "cell to use")
retryDelay = flag.Duration("retry-delay", 2*time.Millisecond, "retry delay")
retryCount = flag.Int("retry-count", 2, "retry count")
connTimeoutTotal = flag.Duration("conn-timeout-total", 3*time.Second, "vttablet connection timeout (total)")
connTimeoutPerConn = flag.Duration("conn-timeout-per-conn", 1500*time.Millisecond, "vttablet connection timeout (per connection)")
connLife = flag.Duration("conn-life", 365*24*time.Hour, "average life of vttablet connections")
maxInFlight = flag.Int("max-in-flight", 0, "maximum number of calls to allow simultaneously")
healthCheckRetryDelay = flag.Duration("healthcheck_retry_delay", 2*time.Millisecond, "health check retry delay")
healthCheckTimeout = flag.Duration("healthcheck_timeout", time.Minute, "the health check timeout period")
tabletTypesToWait = flag.String("tablet_types_to_wait", "", "wait till connected for specified tablet types during Gateway initialization")
testGateway = flag.String("test_gateway", "", "additional gateway to test health check module")
cell = flag.String("cell", "test_nj", "cell to use")
retryCount = flag.Int("retry-count", 2, "retry count")
maxInFlight = flag.Int("max-in-flight", 0, "maximum number of calls to allow simultaneously")
healthCheckConnTimeout = flag.Duration("healthcheck_conn_timeout", 3*time.Second, "healthcheck connection timeout")
healthCheckRetryDelay = flag.Duration("healthcheck_retry_delay", 2*time.Millisecond, "health check retry delay")
healthCheckTimeout = flag.Duration("healthcheck_timeout", time.Minute, "the health check timeout period")
tabletTypesToWait = flag.String("tablet_types_to_wait", "", "wait till connected for specified tablet types during Gateway initialization")
)

var resilientSrvTopoServer *vtgate.ResilientSrvTopoServer
Expand All @@ -62,7 +58,7 @@ func main() {

resilientSrvTopoServer = vtgate.NewResilientSrvTopoServer(ts, "ResilientSrvTopoServer")

healthCheck = discovery.NewHealthCheck(*connTimeoutTotal, *healthCheckRetryDelay, *healthCheckTimeout, "" /* statsSuffix */)
healthCheck = discovery.NewHealthCheck(*healthCheckConnTimeout, *healthCheckRetryDelay, *healthCheckTimeout, "" /* statsSuffix */)

tabletTypes := make([]topodatapb.TabletType, 0, 1)
if len(*tabletTypesToWait) != 0 {
Expand All @@ -75,7 +71,7 @@ func main() {
tabletTypes = append(tabletTypes, tt)
}
}
vtg := vtgate.Init(context.Background(), healthCheck, ts, resilientSrvTopoServer, *cell, *retryDelay, *retryCount, *connTimeoutTotal, *connTimeoutPerConn, *connLife, tabletTypes, *maxInFlight, *testGateway)
vtg := vtgate.Init(context.Background(), healthCheck, ts, resilientSrvTopoServer, *cell, *retryCount, tabletTypes, *maxInFlight)

servenv.OnRun(func() {
addStatusParts(vtg)
Expand Down
203 changes: 0 additions & 203 deletions go/vt/vtgate/balancer.go

This file was deleted.

Loading