diff options
| author | Bruce <half-life@jibudata.com> | 2024-09-05 12:25:04 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-04 21:25:04 -0700 |
| commit | 310d41998d0292654f8d05e02fea2a5fd90d8bc3 (patch) | |
| tree | 230e924ed793c4e1743bc0c6d3db0edea80d6257 | |
| parent | 16984ef07ac4c70b58d462cb6bcc7f3be207a1fa (diff) | |
| download | seaweedfs-310d41998d0292654f8d05e02fea2a5fd90d8bc3.tar.xz seaweedfs-310d41998d0292654f8d05e02fea2a5fd90d8bc3.zip | |
Skip volume data integrity check for volume which has remote file (#5976)
| -rw-r--r-- | weed/storage/volume_loading.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/weed/storage/volume_loading.go b/weed/storage/volume_loading.go index 6e9b2f623..077ce43c6 100644 --- a/weed/storage/volume_loading.go +++ b/weed/storage/volume_loading.go @@ -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 { |
