mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
Ignore version not found in deleteVersions (#14093)
When deleting multiple versions it "gives" up with an errFileVersionNotFound if
a version cannot be found. This effectively skips deleting other versions
sent in the same request.
This can happen on inconsistent objects. We should ignore errFileVersionNotFound
and continue with others.
We already ignore these at the caller level, this PR is continuation of 54a9877
This commit is contained in:
@@ -888,13 +888,19 @@ func (s *xlStorage) deleteVersions(ctx context.Context, volume, path string, fis
|
||||
var (
|
||||
dataDir string
|
||||
lastVersion bool
|
||||
updated bool
|
||||
)
|
||||
|
||||
for _, fi := range fis {
|
||||
dataDir, lastVersion, err = xlMeta.DeleteVersion(fi)
|
||||
if err != nil {
|
||||
if !fi.Deleted && (err == errFileNotFound || err == errFileVersionNotFound) {
|
||||
// Ignore these since
|
||||
continue
|
||||
}
|
||||
return err
|
||||
}
|
||||
updated = true
|
||||
if dataDir != "" {
|
||||
versionID := fi.VersionID
|
||||
if versionID == "" {
|
||||
@@ -918,6 +924,10 @@ func (s *xlStorage) deleteVersions(ctx context.Context, volume, path string, fis
|
||||
}
|
||||
|
||||
if !lastVersion {
|
||||
if !updated {
|
||||
return nil
|
||||
}
|
||||
|
||||
buf, err = xlMeta.AppendTo(metaDataPoolGet())
|
||||
defer metaDataPoolPut(buf)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user