mirror of
https://github.com/minio/minio.git
synced 2025-07-14 19:31:52 -04:00
Revert "Node should clear a lock internally that the lock owner don't recognize (#12782)"
This reverts commit 83676a0bc2ad9ff6fd4d2a52701ed20d1a10c169.
This commit is contained in:
parent
0a276a25cf
commit
a6e8f4aa1c
@ -22,7 +22,6 @@ import (
|
||||
"errors"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"path"
|
||||
"sort"
|
||||
"strconv"
|
||||
@ -304,7 +303,6 @@ func lockMaintenance(ctx context.Context, interval time.Duration) error {
|
||||
for lendpoint, nlrips := range getLongLivedLocks(interval) {
|
||||
nlripsMap := make(map[string]nlock, len(nlrips))
|
||||
for _, nlrip := range nlrips {
|
||||
expiredInOwner := false
|
||||
for _, c := range allLockersFn() {
|
||||
if !c.IsOnline() || c == nil {
|
||||
continue
|
||||
@ -327,18 +325,11 @@ func lockMaintenance(ctx context.Context, interval time.Duration) error {
|
||||
|
||||
if !expired {
|
||||
updateNlocks(nlripsMap, nlrip.name, nlrip.lri.Writer)
|
||||
} else {
|
||||
// Check if the lock owner still recognizes the lock
|
||||
u, err := url.Parse(c.String())
|
||||
if err == nil && u.Host == nlrip.lri.Owner {
|
||||
expiredInOwner = true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Remove the lock if Less than the quorum or the lock owner does not recognize it
|
||||
if expiredInOwner || nlripsMap[nlrip.name].locks < nlrip.lri.Quorum {
|
||||
// less than the quorum, we have locks expired.
|
||||
if nlripsMap[nlrip.name].locks < nlrip.lri.Quorum {
|
||||
// Purge the stale entry if it exists.
|
||||
globalLockServers[lendpoint].removeEntryIfExists(nlrip)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user