mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
volume: report error if a volume has nil data backend
fix https://github.com/chrislusf/seaweedfs/issues/3105
This commit is contained in:
parent
ca16fbf0ef
commit
81d6159290
|
@ -79,6 +79,9 @@ func (v *Volume) Compact2(preallocate int64, compactionBytePerSecond int64, prog
|
||||||
v.lastCompactIndexOffset = v.IndexFileSize()
|
v.lastCompactIndexOffset = v.IndexFileSize()
|
||||||
v.lastCompactRevision = v.SuperBlock.CompactionRevision
|
v.lastCompactRevision = v.SuperBlock.CompactionRevision
|
||||||
glog.V(3).Infof("creating copies for volume %d ...", v.Id)
|
glog.V(3).Infof("creating copies for volume %d ...", v.Id)
|
||||||
|
if v.DataBackend == nil {
|
||||||
|
return fmt.Errorf("volume %d backend is empty remote:%v", v.Id, v.HasRemoteFile())
|
||||||
|
}
|
||||||
if err := v.DataBackend.Sync(); err != nil {
|
if err := v.DataBackend.Sync(); err != nil {
|
||||||
glog.V(0).Infof("compact2 fail to sync volume dat %d: %v", v.Id, err)
|
glog.V(0).Infof("compact2 fail to sync volume dat %d: %v", v.Id, err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue