mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 03:30:35 +00:00
Normalize filesystem/blob logs (#13644)
This commit is contained in:
parent
e09ae75c9f
commit
f85e027141
@ -5,6 +5,7 @@ go_library(
|
|||||||
srcs = [
|
srcs = [
|
||||||
"blob.go",
|
"blob.go",
|
||||||
"ephemeral.go",
|
"ephemeral.go",
|
||||||
|
"log.go",
|
||||||
"metrics.go",
|
"metrics.go",
|
||||||
"pruner.go",
|
"pruner.go",
|
||||||
],
|
],
|
||||||
|
@ -16,7 +16,7 @@ import (
|
|||||||
"github.com/prysmaticlabs/prysm/v5/io/file"
|
"github.com/prysmaticlabs/prysm/v5/io/file"
|
||||||
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
|
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
|
||||||
"github.com/prysmaticlabs/prysm/v5/runtime/logging"
|
"github.com/prysmaticlabs/prysm/v5/runtime/logging"
|
||||||
log "github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"github.com/spf13/afero"
|
"github.com/spf13/afero"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ func (bs *BlobStorage) WarmCache() {
|
|||||||
}
|
}
|
||||||
go func() {
|
go func() {
|
||||||
if err := bs.pruner.prune(0); err != nil {
|
if err := bs.pruner.prune(0); err != nil {
|
||||||
log.WithError(err).Error("Error encountered while warming up blob pruner cache.")
|
log.WithError(err).Error("Error encountered while warming up blob pruner cache")
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ func (bs *BlobStorage) Save(sidecar blocks.VerifiedROBlob) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if exists {
|
if exists {
|
||||||
log.WithFields(logging.BlobFields(sidecar.ROBlob)).Debug("ignoring a duplicate blob sidecar Save attempt")
|
log.WithFields(logging.BlobFields(sidecar.ROBlob)).Debug("Ignoring a duplicate blob sidecar save attempt")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if bs.pruner != nil {
|
if bs.pruner != nil {
|
||||||
@ -126,9 +126,9 @@ func (bs *BlobStorage) Save(sidecar blocks.VerifiedROBlob) error {
|
|||||||
// It's expected to error if the save is successful.
|
// It's expected to error if the save is successful.
|
||||||
err = bs.fs.Remove(partPath)
|
err = bs.fs.Remove(partPath)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(logrus.Fields{
|
||||||
"partPath": partPath,
|
"partPath": partPath,
|
||||||
}).Debugf("removed partial file")
|
}).Debugf("Removed partial file")
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
5
beacon-chain/db/filesystem/log.go
Normal file
5
beacon-chain/db/filesystem/log.go
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package filesystem
|
||||||
|
|
||||||
|
import "github.com/sirupsen/logrus"
|
||||||
|
|
||||||
|
var log = logrus.WithField("prefix", "filesystem")
|
@ -16,7 +16,7 @@ import (
|
|||||||
"github.com/prysmaticlabs/prysm/v5/config/params"
|
"github.com/prysmaticlabs/prysm/v5/config/params"
|
||||||
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
|
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
|
||||||
"github.com/prysmaticlabs/prysm/v5/time/slots"
|
"github.com/prysmaticlabs/prysm/v5/time/slots"
|
||||||
log "github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
"github.com/spf13/afero"
|
"github.com/spf13/afero"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ func (p *blobPruner) prune(pruneBefore primitives.Slot) error {
|
|||||||
}()
|
}()
|
||||||
} else {
|
} else {
|
||||||
defer func() {
|
defer func() {
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(logrus.Fields{
|
||||||
"upToEpoch": slots.ToEpoch(pruneBefore),
|
"upToEpoch": slots.ToEpoch(pruneBefore),
|
||||||
"duration": time.Since(start).String(),
|
"duration": time.Since(start).String(),
|
||||||
"filesRemoved": totalPruned,
|
"filesRemoved": totalPruned,
|
||||||
|
Loading…
Reference in New Issue
Block a user