aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/volume_loading.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-02-11 00:44:40 -0800
committerChris Lu <chris.lu@gmail.com>2021-02-11 00:44:40 -0800
commit885ca34748926b5ffb6fe6ef4cfc5e225bdaa98c (patch)
treea29060d4abe32d855db4d4e21469b8a6af581cb0 /weed/storage/volume_loading.go
parenta0e84c4fbcda5893c5414fe14866f1140f003d7a (diff)
downloadseaweedfs-885ca34748926b5ffb6fe6ef4cfc5e225bdaa98c.tar.xz
seaweedfs-885ca34748926b5ffb6fe6ef4cfc5e225bdaa98c.zip
volume: fail fast if idx files are missing
fix https://github.com/chrislusf/seaweedfs/issues/1796
Diffstat (limited to 'weed/storage/volume_loading.go')
-rw-r--r--weed/storage/volume_loading.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/storage/volume_loading.go b/weed/storage/volume_loading.go
index 52a50a98c..bff1055bb 100644
--- a/weed/storage/volume_loading.go
+++ b/weed/storage/volume_loading.go
@@ -96,6 +96,10 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind
v.dirIdx = v.dir
}
}
+ // check volume idx files
+ if err := v.checkIdxFile(); err != nil {
+ glog.Fatalf("check volume idx file %s: %v", v.FileName(".idx"), err)
+ }
var indexFile *os.File
if v.noWriteOrDelete {
glog.V(0).Infoln("open to read file", v.FileName(".idx"))