From dc84e87c50b70823bad457dd2ed0901b13a68d99 Mon Sep 17 00:00:00 2001 From: Yu Xia Date: Mon, 17 Oct 2022 09:18:00 -0700 Subject: [PATCH] Update replication timestamp with no task (#3487) * Update replication timestamp with no task * Add comment --- service/history/replication/task_processor.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/service/history/replication/task_processor.go b/service/history/replication/task_processor.go index 270e00ad1d0..8985746f4ee 100644 --- a/service/history/replication/task_processor.go +++ b/service/history/replication/task_processor.go @@ -478,6 +478,11 @@ func (p *taskProcessorImpl) paginationFn(_ []byte) ([]interface{}, []byte, error tasks = append(tasks, task) } p.maxRxReceivedTaskID = resp.GetLastRetrievedMessageId() + if len(tasks) == 0 { + // Update processed timestamp to the source cluster time when there is no replication task + p.maxRxProcessedTimestamp = timestamp.TimeValue(resp.GetSyncShardStatus().GetStatusTime()) + } + if resp.GetHasMore() { p.rxTaskBackoff = time.Duration(0) } else {