mirror of
https://github.com/minio/minio.git
synced 2025-11-07 04:42:56 -05:00
heal: Remove empty directories (#11354)
Since the introduction of __XLDIR__, an empty directory does not have a meaning anymore in erasure mode. Make healing removes it wherever it finds it.
This commit is contained in:
@@ -1359,6 +1359,14 @@ func (z *erasureServerPools) HealObjects(ctx context.Context, bucket, prefix str
|
||||
break
|
||||
}
|
||||
|
||||
// Remove empty directories if found - they have no meaning.
|
||||
// Can be left over from highly concurrent put/remove.
|
||||
if quorumCount > set.setDriveCount/2 && entry.IsEmptyDir {
|
||||
if !opts.DryRun && opts.Remove {
|
||||
set.deleteEmptyDir(ctx, bucket, entry.Name)
|
||||
}
|
||||
}
|
||||
|
||||
// Indicate that first attempt was a success and subsequent loop
|
||||
// knows that its not our first attempt at 'prefix'
|
||||
err = nil
|
||||
|
||||
Reference in New Issue
Block a user