mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 14:27:23 +08:00
@@ -59,6 +59,9 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind
|
||||
if alreadyHasSuperBlock {
|
||||
e = v.readSuperBlock()
|
||||
} else {
|
||||
if !v.SuperBlock.Initialized() {
|
||||
return fmt.Errorf("volume %s.dat not initialized", fileName)
|
||||
}
|
||||
e = v.maybeWriteSuperBlock()
|
||||
}
|
||||
if e == nil && alsoLoadIndex {
|
||||
|
@@ -71,6 +71,10 @@ func (s *SuperBlock) Bytes() []byte {
|
||||
return header
|
||||
}
|
||||
|
||||
func (s *SuperBlock) Initialized() bool {
|
||||
return s.ReplicaPlacement != nil && s.Ttl != nil
|
||||
}
|
||||
|
||||
func (v *Volume) maybeWriteSuperBlock() error {
|
||||
|
||||
mMap, exists := memory_map.FileMemoryMap[v.dataFile.Name()]
|
||||
|
Reference in New Issue
Block a user