Skip to content

Commit

Permalink
Adds more pertinent information about replication (cadence-workflow#4931
Browse files Browse the repository at this point in the history
)

Debugging timeout failures in replication is presently quite annoying.
Let's get more visibliity here.

Co-authored-by: Steven L <[email protected]>
  • Loading branch information
davidporter-id-au and Groxx authored Aug 11, 2022
1 parent fe3bf0b commit 385c1c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/history/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,10 @@ func (c *clientImpl) GetReplicationMessages(
requestContext, responseInfo := rpc.ContextWithResponseInfo(requestContext)
resp, err := c.client.GetReplicationMessages(requestContext, req, append(opts, yarpc.WithShardKey(peer))...)
if err != nil {
c.logger.Warn("Failed to get replication tasks from client", tag.Error(err))
c.logger.Warn("Failed to get replication tasks from client",
tag.Error(err),
tag.ShardReplicationToken(req),
)
// Returns service busy error to notify replication
if _, ok := err.(*types.ServiceBusyError); ok {
return err
Expand Down
5 changes: 5 additions & 0 deletions common/log/tag/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@ func ShardReplicationAck(shardReplicationAck int64) Tag {
return newInt64("shard-replication-ack", shardReplicationAck)
}

// ShardReplicationToken returns information about a particular replication request
func ShardReplicationToken(token interface{}) Tag {
return newObjectTag("shard-replication-token", token)
}

// PreviousShardRangeID returns tag for PreviousShardRangeID
func PreviousShardRangeID(id int64) Tag {
return newInt64("previous-shard-range-id", id)
Expand Down

0 comments on commit 385c1c3

Please sign in to comment.