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
This commit is contained in:
Yingrong Zhao 2021-10-18 11:51:10 -04:00 committed by Yingrong Zhao
parent 9773197c61
commit 2df41028a3

View File

@ -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
}