better logging
This commit is contained in:
parent
85f2ac8789
commit
40642b2cad
3
extern/sector-storage/piece_provider.go
vendored
3
extern/sector-storage/piece_provider.go
vendored
@ -80,6 +80,9 @@ func (p *pieceProvider) ReadPiece(ctx context.Context, sector storage.SectorRef,
|
||||
}
|
||||
|
||||
r, unlock, err := p.tryReadUnsealedPiece(ctx, sector, offset, size)
|
||||
|
||||
log.Infof("tryReadUnsealedPiece result: r=%+v, err=%s", r, err)
|
||||
|
||||
if xerrors.Is(err, storiface.ErrSectorNotFound) {
|
||||
log.Debugf("no unsealed sector file with unsealed piece, sector=%+v, offset=%d, size=%d", sector, offset, size)
|
||||
err = nil
|
||||
|
7
extern/sector-storage/stores/remote.go
vendored
7
extern/sector-storage/stores/remote.go
vendored
@ -513,12 +513,14 @@ func (r *Remote) Reader(ctx context.Context, s storage.SectorRef, offset, size a
|
||||
log.Debugf("failed to get sectorsize: %s", err)
|
||||
return nil, err
|
||||
}
|
||||
log.Infof("fetched sector size %s (+%d,%d)", path, offset, size)
|
||||
|
||||
// open the unsealed sector file for the given sector size located at the given path.
|
||||
pf, err := r.pfHandler.OpenPartialFile(abi.PaddedPieceSize(ssize), path)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("opening partial file: %w", err)
|
||||
}
|
||||
log.Infof("partial file opened %s (+%d,%d)", path, offset, size)
|
||||
|
||||
// even though we have an unsealed file for the given sector, we still need to determine if we have the unsealed piece
|
||||
// in the unsealed sector file. That is what `HasAllocated` checks for.
|
||||
@ -526,16 +528,17 @@ func (r *Remote) Reader(ctx context.Context, s storage.SectorRef, offset, size a
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("has allocated: %w", err)
|
||||
}
|
||||
log.Infof("partial file is allocated %s (+%d,%d)", path, offset, size)
|
||||
|
||||
if !has {
|
||||
log.Infof("miner has unsealed file but not unseal piece, %s (+%d,%d)", path, offset, size)
|
||||
if err := r.pfHandler.Close(pf); err != nil {
|
||||
return nil, xerrors.Errorf("close partial file: %w", err)
|
||||
}
|
||||
log.Debugf("miner has unsealed file but not unseal piece, %s (+%d,%d)", path, offset, size)
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
log.Debugf("returning piece reader for local unsealed piece sector=%+v, (offset=%d, size=%d)", s.ID, offset, size)
|
||||
log.Infof("returning piece reader for local unsealed piece sector=%+v, (offset=%d, size=%d)", s.ID, offset, size)
|
||||
return r.pfHandler.Reader(pf, storiface.PaddedByteIndex(offset), size)
|
||||
}
|
||||
|
||||
|
1
extern/sector-storage/worker_local.go
vendored
1
extern/sector-storage/worker_local.go
vendored
@ -428,6 +428,7 @@ func (l *LocalWorker) UnsealPiece(ctx context.Context, sector storage.SectorRef,
|
||||
}
|
||||
|
||||
return l.asyncCall(ctx, sector, UnsealPiece, func(ctx context.Context, ci storiface.CallID) (interface{}, error) {
|
||||
log.Debugf("worker will unseal piece now, sector=%+v", sector.ID)
|
||||
if err = sb.UnsealPiece(ctx, sector, index, size, randomness, cid); err != nil {
|
||||
return nil, xerrors.Errorf("unsealing sector: %w", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user