mirror of
https://github.com/minio/minio.git
synced 2025-07-12 02:21:05 -04:00
fix: lock expiry on zoned setups (#9084)
lock ownership is limited to endpoints on first zone, as we do not hold locks on other zones in an expanded setup. current code unintentionally expired active locks when it couldn't see ownership from the secondary zone which leads to unexpected bugs as locking fails to work as expected.
This commit is contained in:
parent
d9be8bc693
commit
c7ca791c58
@ -247,8 +247,10 @@ func lockMaintenance(ctx context.Context, interval time.Duration, objAPI ObjectL
|
|||||||
// Get list of long lived locks to check for staleness.
|
// Get list of long lived locks to check for staleness.
|
||||||
for lendpoint, nlrips := range getLongLivedLocks(interval) {
|
for lendpoint, nlrips := range getLongLivedLocks(interval) {
|
||||||
for _, nlrip := range nlrips {
|
for _, nlrip := range nlrips {
|
||||||
for _, ep := range globalEndpoints {
|
// Locks are only held on first zone, make sure that
|
||||||
for _, endpoint := range ep.Endpoints {
|
// we only look for ownership of locks from endpoints
|
||||||
|
// on first zone.
|
||||||
|
for _, endpoint := range globalEndpoints[0].Endpoints {
|
||||||
if endpoint.String() == lendpoint.String() {
|
if endpoint.String() == lendpoint.String() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@ -285,7 +287,6 @@ func lockMaintenance(ctx context.Context, interval time.Duration, objAPI ObjectL
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user