From 5e9130dabda7e3d30a3c1ee94e522b0e528413fd Mon Sep 17 00:00:00 2001 From: Yati Padia Date: Tue, 13 Feb 2024 13:59:33 +0530 Subject: [PATCH] rbd: log sitestatuses and description This commit logs sitestatues and description in GetVolumeReplicationInfo RPC call for better debuging. Fixes: #4430 Signed-off-by: Yati Padia --- internal/csi-addons/rbd/replication.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/csi-addons/rbd/replication.go b/internal/csi-addons/rbd/replication.go index a5c400de32fc..0ae30c501648 100644 --- a/internal/csi-addons/rbd/replication.go +++ b/internal/csi-addons/rbd/replication.go @@ -870,6 +870,11 @@ func (rs *ReplicationServer) GetVolumeReplicationInfo(ctx context.Context, } description := remoteStatus.Description + log.UsefulLog( + ctx, + "remote status %q:, description=%q", + remoteStatus + description) resp, err := getLastSyncInfo(description) if err != nil { if errors.Is(err, corerbd.ErrLastSyncTimeNotFound) { @@ -891,6 +896,9 @@ func RemoteStatus(gmis *librbd.GlobalMirrorImageStatus) (librbd.SiteMirrorImageS ss librbd.SiteMirrorImageStatus err error = librbd.ErrNotExist ) + log.UsefulLog( + ctx, + "Site Statuses: %q", gmis.SiteStatuses) for i := range gmis.SiteStatuses { if gmis.SiteStatuses[i].MirrorUUID != "" { ss = gmis.SiteStatuses[i]