Use latest replication task time as sync shard time
@@ -247,12 +247,16 @@ func (p *ackMgrImpl) GetTasks(
p.metricsHandler.Histogram(metrics.ReplicationTasksReturned.GetMetricName(), metrics.ReplicationTasksReturned.GetMetricUnit()).
Record(int64(len(replicationTasks)))
+ replicationEventTime := timestamp.TimePtr(p.shard.GetTimeSource().Now())
+ if len(replicationTasks) > 0 {
+ replicationEventTime = replicationTasks[len(replicationTasks)-1].GetVisibilityTime()
+ }
return &replicationspb.ReplicationMessages{
ReplicationTasks: replicationTasks,
HasMore: lastTaskID < maxTaskID,
LastRetrievedMessageId: lastTaskID,
SyncShardStatus: &replicationspb.SyncShardStatus{
- StatusTime: timestamp.TimePtr(p.shard.GetTimeSource().Now()),
+ StatusTime: replicationEventTime,
},
}, nil
}
