diff --git a/go/vt/srvtopo/resilient_server.go b/go/vt/srvtopo/resilient_server.go index 01e7a0a2746..78fc9134bce 100644 --- a/go/vt/srvtopo/resilient_server.go +++ b/go/vt/srvtopo/resilient_server.go @@ -70,7 +70,6 @@ const ( // - return the last known value of the data if there is an error type ResilientServer struct { topoServer *topo.Server - counts *stats.CountersWithSingleLabel *SrvKeyspaceWatcher *SrvVSchemaWatcher @@ -86,7 +85,6 @@ func NewResilientServer(ctx context.Context, base *topo.Server, counts *stats.Co return &ResilientServer{ topoServer: base, - counts: counts, SrvKeyspaceWatcher: NewSrvKeyspaceWatcher(ctx, base, counts, srvTopoCacheRefresh, srvTopoCacheTTL), SrvVSchemaWatcher: NewSrvVSchemaWatcher(ctx, base, counts, srvTopoCacheRefresh, srvTopoCacheTTL), SrvKeyspaceNamesQuery: NewSrvKeyspaceNamesQuery(base, counts, srvTopoCacheRefresh, srvTopoCacheTTL), diff --git a/go/vt/srvtopo/resilient_server_test.go b/go/vt/srvtopo/resilient_server_test.go index 4831a62219b..c3eda8fa586 100644 --- a/go/vt/srvtopo/resilient_server_test.go +++ b/go/vt/srvtopo/resilient_server_test.go @@ -177,7 +177,7 @@ func TestGetSrvKeyspace(t *testing.T) { // Now simulate a topo service error and see that the last value is // cached for at least half of the expected ttl. errorTestStart := time.Now() - errorReqsBefore := rs.counts.Counts()[errorCategory] + errorReqsBefore := counts.Counts()[errorCategory] forceErr := topo.NewError(topo.Timeout, "test topo error") factory.SetError(forceErr) @@ -273,7 +273,7 @@ func TestGetSrvKeyspace(t *testing.T) { // Check that the expected number of errors were counted during the // interval - errorReqs := rs.counts.Counts()[errorCategory] + errorReqs := counts.Counts()[errorCategory] expectedErrors := int64(time.Since(errorTestStart) / srvTopoCacheRefresh) if errorReqs-errorReqsBefore > expectedErrors { t.Errorf("expected <= %v error requests got %d", expectedErrors, errorReqs-errorReqsBefore) @@ -646,7 +646,7 @@ func TestGetSrvKeyspaceNames(t *testing.T) { t.Errorf("GetSrvKeyspaceNames got %v want %v", names, wantNames) } - errorReqs, ok := rs.counts.Counts()[errorCategory] + errorReqs, ok := counts.Counts()[errorCategory] if !ok || errorReqs == 0 { t.Errorf("expected non-zero error requests got %v", errorReqs) }