diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-03-01 01:20:06 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-03-01 01:20:06 -0800 |
| commit | c46d16b2f32108f4afce601d3c8f0a33f596bce9 (patch) | |
| tree | 8978da232113a8ca1d2ec733118a0599023ab5c2 | |
| parent | 6e43e8ce17dab9b5b99fa9449e869c910981bff9 (diff) | |
| download | seaweedfs-c46d16b2f32108f4afce601d3c8f0a33f596bce9.tar.xz seaweedfs-c46d16b2f32108f4afce601d3c8f0a33f596bce9.zip | |
skip network error when remote volumes start
| -rw-r--r-- | weed/storage/super_block/replica_placement.go | 3 | ||||
| -rw-r--r-- | weed/storage/volume_loading.go | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/weed/storage/super_block/replica_placement.go b/weed/storage/super_block/replica_placement.go index 65ec53819..a263e6669 100644 --- a/weed/storage/super_block/replica_placement.go +++ b/weed/storage/super_block/replica_placement.go @@ -36,6 +36,9 @@ func NewReplicaPlacementFromByte(b byte) (*ReplicaPlacement, error) { } func (rp *ReplicaPlacement) Byte() byte { + if rp == nil { + return 0 + } ret := rp.DiffDataCenterCount*100 + rp.DiffRackCount*10 + rp.SameRackCount return byte(ret) } diff --git a/weed/storage/volume_loading.go b/weed/storage/volume_loading.go index 7f70031ed..0cf603ad8 100644 --- a/weed/storage/volume_loading.go +++ b/weed/storage/volume_loading.go @@ -84,6 +84,11 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind if alreadyHasSuperBlock { err = v.readSuperBlock() glog.V(0).Infof("readSuperBlock volume %d version %v", v.Id, v.SuperBlock.Version) + if v.HasRemoteFile() { + // maybe temporary network problem + glog.Errorf("readSuperBlock remote volume %d: %v", v.Id, err) + err = nil + } } else { if !v.SuperBlock.Initialized() { return fmt.Errorf("volume %s not initialized", v.FileName(".dat")) |
