mirror of
https://github.com/pgsty/minio.git
synced 2026-07-25 06:56:18 +03:00
avoid healObjects recursively healing at empty path (#11856)
baseDirFromPrefix(prefix) for object names without parent directory incorrectly uses empty path, leading to long listing at various paths that are not useful for healing - avoid this listing completely if "baseDir" returns empty simple use the "prefix" as is. this improves startup performance significantly
This commit is contained in:
@@ -1563,10 +1563,15 @@ func (z *erasureServerPools) HealObjects(ctx context.Context, bucket, prefix str
|
|||||||
bucket: bucket,
|
bucket: bucket,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
path := baseDirFromPrefix(prefix)
|
||||||
|
if path == "" {
|
||||||
|
path = prefix
|
||||||
|
}
|
||||||
|
|
||||||
if err := listPathRaw(ctx, listPathRawOptions{
|
if err := listPathRaw(ctx, listPathRawOptions{
|
||||||
disks: disks,
|
disks: disks,
|
||||||
bucket: bucket,
|
bucket: bucket,
|
||||||
path: baseDirFromPrefix(prefix),
|
path: path,
|
||||||
recursive: true,
|
recursive: true,
|
||||||
forwardTo: "",
|
forwardTo: "",
|
||||||
minDisks: 1,
|
minDisks: 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user