Skip to content

Commit

Permalink
Add more logs for debugging namespace handover issue
Browse files Browse the repository at this point in the history
  • Loading branch information
meiliang86 committed Mar 21, 2022
1 parent 873b4ce commit 74f14ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions service/history/shard/context_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,14 @@ func (s *ContextImpl) UpdateHandoverNamespaces(namespaces []*namespace.Namespace
delete(s.handoverNamespaces, k)
}
}

var namespaceNames []string
for _, ns := range namespaces {
namespaceNames = append(namespaceNames, ns.Name().String())
}

s.GetLogger().Info("Namespace handover info updated.", tag.TaskID(maxRepTaskID), tag.NewAnyTag("namespace-names", namespaceNames),
tag.ShardID(s.shardID), tag.NewAnyTag("handover-namespace-info", s.handoverNamespaces))
}

func (s *ContextImpl) GetTimerMaxReadLevel(cluster string) time.Time {
Expand Down
4 changes: 4 additions & 0 deletions service/worker/migration/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,10 @@ func (a *activities) checkHandoverOnce(ctx context.Context, waitRequest waitHand
metrics.TargetClusterTag(waitRequest.RemoteCluster),
metrics.NamespaceTag(waitRequest.Namespace),
).UpdateGauge(metrics.HandoverReadyShardCountGauge, float64(readyShardCount))
a.logger.Info("Wait handover ready shard count.",
tag.NewInt("ReadyShards", readyShardCount),
tag.NewStringTag("Namespace", waitRequest.Namespace),
tag.NewStringTag("RemoteCluster", waitRequest.RemoteCluster))

return readyShardCount == len(resp.Shards), nil
}
Expand Down

0 comments on commit 74f14ee

Please sign in to comment.