stores: Report storage changes quickly
This commit is contained in:
parent
95d9084899
commit
fbc05fa5a8
10
extern/sector-storage/stores/local.go
vendored
10
extern/sector-storage/stores/local.go
vendored
@ -298,6 +298,11 @@ func (st *Local) reportHealth(ctx context.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
st.reportStorage(ctx)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (st *Local) reportStorage(ctx context.Context) {
|
||||||
st.localLk.RLock()
|
st.localLk.RLock()
|
||||||
|
|
||||||
toReport := map[ID]HealthReport{}
|
toReport := map[ID]HealthReport{}
|
||||||
@ -317,7 +322,6 @@ func (st *Local) reportHealth(ctx context.Context) {
|
|||||||
log.Warnf("error reporting storage health for %s (%+v): %+v", id, report, err)
|
log.Warnf("error reporting storage health for %s (%+v): %+v", id, report, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (st *Local) Reserve(ctx context.Context, sid abi.SectorID, ssize abi.SectorSize, ft storiface.SectorFileType, storageIDs storiface.SectorPaths, overheadTab map[storiface.SectorFileType]int) (func(), error) {
|
func (st *Local) Reserve(ctx context.Context, sid abi.SectorID, ssize abi.SectorSize, ft storiface.SectorFileType, storageIDs storiface.SectorPaths, overheadTab map[storiface.SectorFileType]int) (func(), error) {
|
||||||
@ -568,6 +572,8 @@ func (st *Local) removeSector(ctx context.Context, sid abi.SectorID, typ storifa
|
|||||||
log.Errorf("removing sector (%v) from %s: %+v", sid, spath, err)
|
log.Errorf("removing sector (%v) from %s: %+v", sid, spath, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
st.reportStorage(ctx) // report freed space
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -623,6 +629,8 @@ func (st *Local) MoveStorage(ctx context.Context, s abi.SectorID, ssize abi.Sect
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
st.reportStorage(ctx) // report space use changes
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user