Skip to content

Commit

Permalink
Skip volume data integrity check for volume which has remote file (se…
Browse files Browse the repository at this point in the history
  • Loading branch information
half-life666 committed Sep 5, 2024
1 parent 16984ef commit 310d419
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions weed/storage/volume_loading.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
if v.lastAppendAtNs, err = CheckAndFixVolumeDataIntegrity(v, indexFile); err != nil {
v.noWriteOrDelete = true
glog.V(0).Infof("volumeDataIntegrityChecking failed %v", err)
// Do not need to check the data integrity for remote volumes,
// since the remote storage tier may have larger capacity, the volume
// 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 {
Expand Down

0 comments on commit 310d419

Please sign in to comment.