mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
object layer initialization using distributed locking (#2397)
* vendorized latest minio/dsync * wip - object layer initialization using distributed locking
This commit is contained in:
committed by
Harshavardhana
parent
3939c75345
commit
b7c169d71d
@@ -49,6 +49,11 @@ func newObjectLayerFactory(disks, ignoredDisks []string) func() ObjectLayer {
|
||||
if objAPI != nil {
|
||||
return objAPI
|
||||
}
|
||||
|
||||
// Acquire a distributed lock to ensure only one of the nodes
|
||||
// initializes the format.json.
|
||||
nsMutex.Lock(minioMetaBucket, formatConfigFile)
|
||||
defer nsMutex.Unlock(minioMetaBucket, formatConfigFile)
|
||||
objAPI, err = newObjectLayer(disks, ignoredDisks)
|
||||
if err != nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user