|
|
@ -118,12 +118,8 @@ func verifyNeedleIntegrity(datFile backend.BackendStorageFile, v needle.Version, |
|
|
|
return n.AppendAtNs, nil |
|
|
|
} |
|
|
|
if fileSize > fileTailOffset { |
|
|
|
glog.Warningf("Truncate %s from %d bytes to %d bytes!", datFile.Name(), fileSize, fileTailOffset) |
|
|
|
err = datFile.Truncate(fileTailOffset) |
|
|
|
if err == nil { |
|
|
|
return n.AppendAtNs, nil |
|
|
|
} |
|
|
|
return n.AppendAtNs, fmt.Errorf("truncate file %s: %v", datFile.Name(), err) |
|
|
|
glog.Warningf("data file %s actual %d bytes expected %d bytes!", datFile.Name(), fileSize, fileTailOffset) |
|
|
|
return n.AppendAtNs, fmt.Errorf("data file %s actual %d bytes expected %d bytes", datFile.Name(), fileSize, fileTailOffset) |
|
|
|
} |
|
|
|
glog.Warningf("data file %s has %d bytes, less than expected %d bytes!", datFile.Name(), fileSize, fileTailOffset) |
|
|
|
} |
|
|
|