heal: Include dir markers when healing a fresh disk (#15158)

Directories markers are not healed when healing a new fresh disk. A
a proper fix would be moving object names encoding/decoding to erasure
object level but it is too late now since the object to set distribution is
calculated at a higher level.
This commit is contained in:
Anis Elleuch 2022-06-23 14:47:33 +01:00 committed by GitHub
parent 1a40c7c27c
commit 42e2fd35d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -269,8 +269,11 @@ func (er *erasureObjects) healErasureSet(ctx context.Context, buckets []string,
return
}
// erasureObjects layer needs object names to be encoded
encodedEntryName := encodeDirObject(entry.name)
for _, version := range fivs.Versions {
if _, err := er.HealObject(ctx, bucket, version.Name,
if _, err := er.HealObject(ctx, bucket, encodedEntryName,
version.VersionID, madmin.HealOpts{
ScanMode: scanMode,
Remove: healDeleteDangling,