fix: keep locks on same pool for simplicity (#20356)

locks handed by different pools would become non-compete for
multi-object delete request, this is wrong for obvious 
reasons.

New locking implementation and revamp will rewrite multi-object
lock anyway, this is a workaround for now.
This commit is contained in:
Harshavardhana 2024-08-30 19:26:49 -07:00 committed by GitHub
parent bb07df7e7b
commit 6c746843ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -220,11 +220,7 @@ func newErasureServerPools(ctx context.Context, endpointServerPools EndpointServ
}
func (z *erasureServerPools) NewNSLock(bucket string, objects ...string) RWLocker {
poolID := hashKey(z.distributionAlgo, "", len(z.serverPools), z.deploymentID)
if len(objects) >= 1 {
poolID = hashKey(z.distributionAlgo, objects[0], len(z.serverPools), z.deploymentID)
}
return z.serverPools[poolID].NewNSLock(bucket, objects...)
return z.serverPools[0].NewNSLock(bucket, objects...)
}
// GetDisksID will return disks by their ID.