mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
use renameAll instead of deleteAll for metacache-manager (#13005)
renameAll is cheaper, rely on background deletes instead.
This commit is contained in:
parent
202d0b64eb
commit
e9d970154d
@ -122,7 +122,7 @@ func (er erasureObjects) renameAll(ctx context.Context, bucket, prefix string) {
|
|||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go func(disk StorageAPI) {
|
go func(disk StorageAPI) {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
disk.RenameFile(ctx, bucket, prefix, minioMetaTmpBucket, mustGetUUID())
|
disk.RenameFile(ctx, bucket, prefix, minioMetaTmpDeletedBucket, mustGetUUID())
|
||||||
}(disk)
|
}(disk)
|
||||||
}
|
}
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
@ -1421,20 +1421,8 @@ func (z *erasureServerPools) DeleteBucket(ctx context.Context, bucket string, fo
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// deleteAll will delete a bucket+prefix unconditionally across all disks.
|
|
||||||
// Note that set distribution is ignored so it should only be used in cases where
|
|
||||||
// data is not distributed across sets.
|
|
||||||
// Errors are logged but individual disk failures are not returned.
|
|
||||||
func (z *erasureServerPools) deleteAll(ctx context.Context, bucket, prefix string) {
|
|
||||||
for _, servers := range z.serverPools {
|
|
||||||
for _, set := range servers.sets {
|
|
||||||
set.deleteAll(ctx, bucket, prefix)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// renameAll will rename bucket+prefix unconditionally across all disks to
|
// renameAll will rename bucket+prefix unconditionally across all disks to
|
||||||
// minioMetaTmpBucket + unique uuid,
|
// minioMetaTmpDeletedBucket + unique uuid,
|
||||||
// Note that set distribution is ignored so it should only be used in cases where
|
// Note that set distribution is ignored so it should only be used in cases where
|
||||||
// data is not distributed across sets. Errors are logged but individual
|
// data is not distributed across sets. Errors are logged but individual
|
||||||
// disk failures are not returned.
|
// disk failures are not returned.
|
||||||
|
@ -149,5 +149,5 @@ func (m *metacache) delete(ctx context.Context) {
|
|||||||
logger.LogIf(ctx, errors.New("metacache.delete: expected objAPI to be *erasureServerPools"))
|
logger.LogIf(ctx, errors.New("metacache.delete: expected objAPI to be *erasureServerPools"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ez.deleteAll(ctx, minioMetaBucket, metacachePrefixForID(m.bucket, m.id))
|
ez.renameAll(ctx, minioMetaBucket, metacachePrefixForID(m.bucket, m.id))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user