From ba6391831ff9037e42f83417e1ed9d93186de347 Mon Sep 17 00:00:00 2001 From: wxing1292 Date: Tue, 3 Oct 2023 17:10:01 -0700 Subject: [PATCH] Improve XDC logging (#4932) **What changed?** * Improve XDC logging **Why?** Improve XDC logging **How did you test it?** N/A **Potential risks** N/A **Is hotfix candidate?** N/A --- .../namespace_replication_message_processor.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/service/worker/replicator/namespace_replication_message_processor.go b/service/worker/replicator/namespace_replication_message_processor.go index 8e2979d4c80..f0086dd23e2 100644 --- a/service/worker/replicator/namespace_replication_message_processor.go +++ b/service/worker/replicator/namespace_replication_message_processor.go @@ -242,9 +242,21 @@ func (p *namespaceReplicationMessageProcessor) handleNamespaceReplicationTask( switch task.TaskType { case enumsspb.REPLICATION_TASK_TYPE_NAMESPACE_TASK: - return p.namespaceTaskExecutor.Execute(ctx, task.GetNamespaceTaskAttributes()) + attr := task.GetNamespaceTaskAttributes() + err := p.namespaceTaskExecutor.Execute(ctx, attr) + if err != nil { + p.logger.Error("unable to process namespace replication task", + tag.WorkflowNamespaceID(attr.Id)) + } + return err case enumsspb.REPLICATION_TASK_TYPE_TASK_QUEUE_USER_DATA: - return p.handleTaskQueueUserDataReplicationTask(ctx, task.GetTaskQueueUserDataAttributes()) + attr := task.GetTaskQueueUserDataAttributes() + err := p.handleTaskQueueUserDataReplicationTask(ctx, attr) + if err != nil { + p.logger.Error(fmt.Sprintf("unable to process task queue metadata replication task, %v", attr.TaskQueueName), + tag.WorkflowNamespaceID(attr.NamespaceId)) + } + return err default: return fmt.Errorf("cannot handle replication task of type %v", task.TaskType) }