mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
wait on parallel decom to complete before returning (#14764)
without this wait there is a potential for some objects that are in actively being decommissioned would cancel, however the decommission status might wrongly conclude this as "Complete". To avoid this make sure to add waitgroups on the parallel workers, allowing parallel copies to complete fully before we return.
This commit is contained in:
parent
c526fa9119
commit
7e248fc0ba
@ -603,6 +603,7 @@ func (z *erasureServerPools) decommissionPool(ctx context.Context, idx int, pool
|
||||
decommissionEntry := func(entry metaCacheEntry) {
|
||||
defer func() {
|
||||
<-parallelWorkers
|
||||
wg.Done()
|
||||
}()
|
||||
if entry.isDir() {
|
||||
return
|
||||
@ -719,12 +720,14 @@ func (z *erasureServerPools) decommissionPool(ctx context.Context, idx int, pool
|
||||
reportNotFound: false,
|
||||
agreed: func(entry metaCacheEntry) {
|
||||
parallelWorkers <- struct{}{}
|
||||
wg.Add(1)
|
||||
go decommissionEntry(entry)
|
||||
},
|
||||
partial: func(entries metaCacheEntries, nAgreed int, errs []error) {
|
||||
entry, ok := entries.resolve(&resolver)
|
||||
if ok {
|
||||
parallelWorkers <- struct{}{}
|
||||
wg.Add(1)
|
||||
go decommissionEntry(*entry)
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user