fix write volume over size MaxPossibleVolumeSize (#5190)

Co-authored-by: Yang Wang <yangwang@weride.ai>
This commit is contained in:
skycope
2024-01-12 12:23:46 +08:00
committed by GitHub
parent b0ac3ebd6c
commit 0e8a54f6f6
2 changed files with 1 additions and 14 deletions

View File

@@ -127,7 +127,7 @@ func (n *Needle) Append(w backend.BackendStorageFile, version Version) (offset u
err = fmt.Errorf("Cannot Read Current Volume Position: %v", e)
return
}
if offset >= MaxPossibleVolumeSize && n.Size.IsValid() {
if offset >= MaxPossibleVolumeSize && len(n.Data) != 0 {
err = fmt.Errorf("Volume Size %d Exceeded %d", offset, MaxPossibleVolumeSize)
return
}