Skip volume data integrity check for volume which has remote file (#5976)
This commit is contained in:
@@ -123,9 +123,17 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind
|
|||||||
return fmt.Errorf("cannot write Volume Index %s: %v", v.FileName(".idx"), err)
|
return fmt.Errorf("cannot write Volume Index %s: %v", v.FileName(".idx"), err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if v.lastAppendAtNs, err = CheckAndFixVolumeDataIntegrity(v, indexFile); err != nil {
|
// Do not need to check the data integrity for remote volumes,
|
||||||
v.noWriteOrDelete = true
|
// since the remote storage tier may have larger capacity, the volume
|
||||||
glog.V(0).Infof("volumeDataIntegrityChecking failed %v", err)
|
// data read will trigger the ReadAt() function to read from the remote
|
||||||
|
// storage tier, and download to local storage, which may cause the
|
||||||
|
// capactiy overloading.
|
||||||
|
if !v.HasRemoteFile() {
|
||||||
|
glog.V(0).Infof("checking volume data integrity for volume %d", v.Id)
|
||||||
|
if v.lastAppendAtNs, err = CheckAndFixVolumeDataIntegrity(v, indexFile); err != nil {
|
||||||
|
v.noWriteOrDelete = true
|
||||||
|
glog.V(0).Infof("volumeDataIntegrityChecking failed %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if v.noWriteOrDelete || v.noWriteCanDelete {
|
if v.noWriteOrDelete || v.noWriteCanDelete {
|
||||||
|
|||||||
Reference in New Issue
Block a user