Skip to content
Merged
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
12 changes: 12 additions & 0 deletions go/vt/discovery/keyspace_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,12 @@ func (kew *KeyspaceEventWatcher) run(ctx context.Context) {
func (kss *keyspaceState) ensureConsistentLocked() {
// if this keyspace is consistent, there's no ongoing availability event
if kss.consistent {
log.V(2).Infof("keyspace %s: already consistent, skipping ensureConsistentLocked", kss.keyspace)
return
}

if kss.moveTablesState != nil && kss.moveTablesState.Typ != MoveTablesNone && kss.moveTablesState.State != MoveTablesSwitched {
log.Infof("keyspace %s: MoveTables operation in progress, not marking consistent yet", kss.keyspace)
return
}

Expand All @@ -277,6 +279,12 @@ func (kss *keyspaceState) ensureConsistentLocked() {
// if there are ShardTabletControls active, the keyspace is undergoing a topology change;
// either way, the availability event is still ongoing
if primary == nil || len(primary.ShardTabletControls) > 0 {
if primary == nil {
log.Infof("keyspace %s: primary partition is nil, not marking consistent yet", kss.keyspace)
} else {
log.Infof("keyspace %s: ShardTabletControls still active (%d controls), not marking consistent yet",
kss.keyspace, len(primary.ShardTabletControls))
}
return
}

Expand All @@ -289,6 +297,8 @@ func (kss *keyspaceState) ensureConsistentLocked() {
for _, shard := range primary.ShardReferences {
sstate := kss.shards[shard.Name]
if sstate == nil || !sstate.serving {
log.Infof("keyspace %s, shard %s: shard state not ready (nil: %v, serving: %v), not marking consistent yet",
kss.keyspace, shard.Name, sstate == nil, sstate != nil && sstate.serving)
return
}
activeShardsInPartition[shard.Name] = true
Expand All @@ -299,6 +309,8 @@ func (kss *keyspaceState) ensureConsistentLocked() {
// watcher, it means the keyspace is not fully consistent yet
for shard, sstate := range kss.shards {
if sstate.serving && !activeShardsInPartition[shard] {
log.Infof("keyspace %s, shard %s: shard is serving in healthcheck but not in topology partition, not marking consistent yet",
kss.keyspace, shard)
return
}
}
Expand Down
Loading