From 7fac646923aae833fed2e1fea7e9f881cb9e9604 Mon Sep 17 00:00:00 2001 From: Feng Ruohang Date: Thu, 5 Nov 2026 06:50:32 +0800 Subject: [PATCH] refactor(restore): take the restore lock from the object lock domain Native restore chose its own single-pool lock in the object's erasure set before the pools layer did. Now that every object write locks in that domain through NewObjectNSLock, the restore lock is that lock. Behavior is unchanged. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Feng Ruohang --- cmd/restore-attempt.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cmd/restore-attempt.go b/cmd/restore-attempt.go index 0df3e36fd..e95903dd3 100644 --- a/cmd/restore-attempt.go +++ b/cmd/restore-attempt.go @@ -648,12 +648,9 @@ func (er erasureObjects) restoreUploadActive(ctx context.Context, v restoreUploa } // restoreLock is the object lock that restores and their status updates -// share: with one pool the set's own lock, as single-pool writes use. +// share: the lock every write of the object takes. func (z *erasureServerPools) restoreLock(bucket, object string) RWLocker { - if z.SinglePool() { - return z.serverPools[0].getHashedSet(object).NewNSLock(bucket, object) - } - return z.NewNSLock(bucket, object) + return z.NewObjectNSLock(bucket, object) } // restoreRequestStatus is what a POST restore recorded on its version.