From 2df41028a3ec9e5026c0b9691367fb6c82da8e99 Mon Sep 17 00:00:00 2001 From: Yingrong Zhao Date: Mon, 18 Oct 2021 11:51:10 -0400 Subject: [PATCH] storagenode/piecestore: add logs for restore trash endpoint When a satellite operator runs restore trash command, it's hard for node operator to know whether their node has received the request. Adding logs so this process is visible from node operators perspective. Change-Id: I08c670b1b0c5971e6b73e038a0935cb0caaca63d --- storagenode/piecestore/endpoint.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/storagenode/piecestore/endpoint.go b/storagenode/piecestore/endpoint.go index f374132af..91a7834b1 100644 --- a/storagenode/piecestore/endpoint.go +++ b/storagenode/piecestore/endpoint.go @@ -730,10 +730,13 @@ func (endpoint *Endpoint) RestoreTrash(ctx context.Context, restoreTrashReq *pb. return nil, rpcstatus.Error(rpcstatus.PermissionDenied, "RestoreTrash called with untrusted ID") } + endpoint.log.Info("restore trash started", zap.Stringer("Satellite ID", peer.ID)) err = endpoint.store.RestoreTrash(ctx, peer.ID) if err != nil { + endpoint.log.Error("restore trash failed", zap.Stringer("Satellite ID", peer.ID), zap.Error(err)) return nil, rpcstatus.Wrap(rpcstatus.Internal, err) } + endpoint.log.Info("restore trash finished", zap.Stringer("Satellite ID", peer.ID)) return &pb.RestoreTrashResponse{}, nil }