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 <noreply@anthropic.com>
Signed-off-by: Feng Ruohang <rh@vonng.com>
This commit is contained in:
Feng Ruohang
2026-11-05 06:50:32 +08:00
parent 32ab506924
commit 7fac646923
+2 -5
View File
@@ -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.