fix possible crashes on deleteMarker replication (#11308)

Delete marker can have `metaSys` set to nil, that
can lead to crashes after the delete marker has
been healed.

Additionally also fix isObjectDangling check
for transitioned objects, that do not have parts
should be treated similar to Delete marker.
This commit is contained in:
Harshavardhana
2021-01-20 13:12:12 -08:00
committed by GitHub
parent dac19d7272
commit d1a8f0b786
4 changed files with 33 additions and 28 deletions

View File

@@ -962,7 +962,7 @@ func (s *xlStorage) DeleteVersion(ctx context.Context, volume, path string, fi F
}
// when data-dir is specified. Transition leverages existing DeleteObject
// api call to mark object as deleted.When object is pending transition,
// api call to mark object as deleted. When object is pending transition,
// just update the metadata and avoid deleting data dir.
if dataDir != "" && fi.TransitionStatus != lifecycle.TransitionPending {
filePath := pathJoin(volumeDir, path, dataDir)
@@ -974,6 +974,7 @@ func (s *xlStorage) DeleteVersion(ctx context.Context, volume, path string, fi F
return err
}
}
// transitioned objects maintains metadata on the source cluster. When transition
// status is set, update the metadata to disk.
if !lastVersion || fi.TransitionStatus != "" {