mirror of
https://github.com/pgsty/minio.git
synced 2026-11-09 17:21:51 +03:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user