storagenode: fixed logging about piece being moved to trash, and added logging when piece was actually deleted

Change-Id: I46f6a141b27033c2087b5c4681506d80b90f4a18
This commit is contained in:
Qweder93 2020-08-02 20:00:05 +03:00
parent 20184d3604
commit 53a5d18e1a
3 changed files with 5 additions and 2 deletions

View File

@ -231,6 +231,7 @@ func (blobs *BlobsUsageCache) Delete(ctx context.Context, blobRef storage.BlobRe
return err
}
blobs.Update(ctx, satelliteID, -pieceTotal, -pieceContentSize, 0)
blobs.log.Debug("deleted piece", zap.String("satelliteID", satelliteID.String()), zap.Int64("space was freed", pieceContentSize))
return nil
}

View File

@ -295,6 +295,8 @@ func (store *Store) Delete(ctx context.Context, satellite storj.NodeID, pieceID
err = errs.Combine(err, store.v0PieceInfo.Delete(ctx, satellite, pieceID))
}
store.log.Debug("deleted piece", zap.String("satelliteID", satellite.String()), zap.String("pieceID", pieceID.String()))
return Error.Wrap(err)
}

View File

@ -378,7 +378,7 @@ func (s *Service) retainPieces(ctx context.Context, req Request) (err error) {
}
pieceID := access.PieceID()
if !filter.Contains(pieceID) {
s.log.Debug("About to delete piece id",
s.log.Debug("About to move piece to trash",
zap.Stringer("Satellite ID", satelliteID),
zap.Stringer("Piece ID", pieceID),
zap.String("Status", s.config.Status.String()))
@ -408,7 +408,7 @@ func (s *Service) retainPieces(ctx context.Context, req Request) (err error) {
return Error.Wrap(err)
}
mon.IntVal("garbage_collection_pieces_deleted").Observe(int64(numDeleted))
s.log.Debug("Deleted pieces during retain", zap.Int("num deleted", numDeleted), zap.String("Retain Status", s.config.Status.String()))
s.log.Debug("Moved pieces to trash during retain", zap.Int("num deleted", numDeleted), zap.String("Retain Status", s.config.Status.String()))
return nil
}