shell: add volume.check.disk to fix inconsistency for replicated volumes

fix https://github.com/chrislusf/seaweedfs/issues/1923
This commit is contained in:
Chris Lu
2021-03-22 00:03:16 -07:00
parent df461402cc
commit b465095db1
12 changed files with 1565 additions and 801 deletions

View File

@@ -58,6 +58,14 @@ func (v *Volume) readNeedle(n *needle.Needle, readOption *ReadOption) (int, erro
return -1, ErrorNotFound
}
// read fills in Needle content by looking up n.Id from NeedleMapper
func (v *Volume) ReadNeedleBlob(offset int64, size Size) ([]byte, error) {
v.dataFileAccessLock.RLock()
defer v.dataFileAccessLock.RUnlock()
return needle.ReadNeedleBlob(v.DataBackend, offset, size, v.Version())
}
type VolumeFileScanner interface {
VisitSuperBlock(super_block.SuperBlock) error
ReadNeedleBody() bool