mirror of
https://github.com/minio/minio.git
synced 2025-01-23 04:33:15 -05:00
locking: Fix wrong map id (#14184)
Wrong resource is being fetched, since idx is incremented, but mapID is reused. Regression caused by #13454 - that part didn't optimize anything anyway.
This commit is contained in:
parent
a8ba71edef
commit
7db05a80dd
@ -322,11 +322,10 @@ func (l *localLocker) Refresh(ctx context.Context, args dsync.LockArgs) (refresh
|
|||||||
}
|
}
|
||||||
idx := 0
|
idx := 0
|
||||||
for {
|
for {
|
||||||
mapID := formatUUID(args.UID, idx)
|
|
||||||
lris, ok := l.lockMap[resource]
|
lris, ok := l.lockMap[resource]
|
||||||
if !ok {
|
if !ok {
|
||||||
// Inconsistent. Delete UID.
|
// Inconsistent. Delete UID.
|
||||||
delete(l.lockUID, mapID)
|
delete(l.lockUID, formatUUID(args.UID, idx))
|
||||||
return idx > 0, nil
|
return idx > 0, nil
|
||||||
}
|
}
|
||||||
for i := range lris {
|
for i := range lris {
|
||||||
@ -335,7 +334,7 @@ func (l *localLocker) Refresh(ctx context.Context, args dsync.LockArgs) (refresh
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
idx++
|
idx++
|
||||||
resource, ok = l.lockUID[mapID]
|
resource, ok = l.lockUID[formatUUID(args.UID, idx)]
|
||||||
if !ok {
|
if !ok {
|
||||||
// No more resources for UID, but we did update at least one.
|
// No more resources for UID, but we did update at least one.
|
||||||
return true, nil
|
return true, nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user