Skip to content

Commit

Permalink
Merge pull request #3084 from gentryx/master
Browse files Browse the repository at this point in the history
add log message if new tablet doesn't have a sufficiently new timesta…
  • Loading branch information
sougou authored Aug 17, 2017
2 parents 78748ce + 3f9f5f7 commit 8ac93ef
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions go/vt/discovery/tablet_stats_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ package discovery
import (
"sync"

log "github.com/golang/glog"
querypb "github.com/youtube/vitess/go/vt/proto/query"
topodatapb "github.com/youtube/vitess/go/vt/proto/topodata"
"github.com/youtube/vitess/go/vt/topo/topoproto"
)

// TabletStatsCache is a HealthCheckStatsListener that keeps both the
Expand Down Expand Up @@ -193,9 +195,13 @@ func (tc *TabletStatsCache) StatsUpdate(ts *TabletStats) {

// We already have one up server, see if we
// need to replace it.
if e.healthy[0].TabletExternallyReparentedTimestamp > ts.TabletExternallyReparentedTimestamp {
// The notification we just got is older than
// the one we had before, discard it.
if ts.TabletExternallyReparentedTimestamp < e.healthy[0].TabletExternallyReparentedTimestamp {
log.Warningf("not marking healthy master as Up because its externally reparented timestamp is smaller than the highest known timestamp from previous MASTERs: %d < %d ",
ts.TabletExternallyReparentedTimestamp,
e.healthy[0].TabletExternallyReparentedTimestamp,
topoproto.KeyspaceShardString(ts.Target.Keyspace, ts.Target.Shard),
topoproto.TabletAliasString(ts.Tablet.Alias),
topoproto.TabletAliasString(e.healthy[0].Tablet.Alias))
return
}

Expand Down

0 comments on commit 8ac93ef

Please sign in to comment.