volume: compaction can cause readonly volumes

address https://github.com/chrislusf/seaweedfs/issues/1233
This commit is contained in:
Chris Lu
2020-03-17 09:43:57 -07:00
parent 12df236def
commit c3cb6fa1d7
9 changed files with 239 additions and 215 deletions

View File

@@ -58,7 +58,7 @@ func readIndexEntryAtOffset(indexFile *os.File, offset int64) (bytes []byte, err
func verifyNeedleIntegrity(datFile backend.BackendStorageFile, v needle.Version, offset int64, key NeedleId, size uint32) (lastAppendAtNs uint64, err error) {
n := new(needle.Needle)
if err = n.ReadData(datFile, offset, size, v); err != nil {
return n.AppendAtNs, err
return n.AppendAtNs, fmt.Errorf("read data [%d,%d) : %v", offset, offset+int64(size), err)
}
if n.Id != key {
return n.AppendAtNs, fmt.Errorf("index key %#x does not match needle's Id %#x", key, n.Id)