mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -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
3
vendor/github.com/minio/dsync/dmutex.go
generated
vendored
3
vendor/github.com/minio/dsync/dmutex.go
generated
vendored
@@ -21,7 +21,6 @@ import (
|
||||
"math"
|
||||
"math/rand"
|
||||
"net/rpc"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
@@ -52,7 +51,7 @@ func connectLazy(dm *DMutex) {
|
||||
for i := range dm.clnts {
|
||||
if dm.clnts[i] == nil {
|
||||
// pass in unique path (as required by server.HandleHTTP()
|
||||
dm.clnts[i], _ = rpc.DialHTTPPath("tcp", nodes[i], rpcPath+"-"+strings.Split(nodes[i], ":")[1])
|
||||
dm.clnts[i], _ = rpc.DialHTTPPath("tcp", nodes[i], rpcPaths[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
9
vendor/github.com/minio/dsync/dsync.go
generated
vendored
9
vendor/github.com/minio/dsync/dsync.go
generated
vendored
@@ -28,7 +28,7 @@ const DefaultPath = "/rpc/dsync"
|
||||
|
||||
var n int
|
||||
var nodes []string
|
||||
var rpcPath string
|
||||
var rpcPaths []string
|
||||
|
||||
func closeClients(clients []*rpc.Client) {
|
||||
for _, clnt := range clients {
|
||||
@@ -36,8 +36,8 @@ func closeClients(clients []*rpc.Client) {
|
||||
}
|
||||
}
|
||||
|
||||
// Same as SetNodes, but takes a path argument different from the package-level default.
|
||||
func SetNodesWithPath(nodeList []string, path string) (err error) {
|
||||
// Same as SetNodes, but takes a slice of rpc paths as argument different from the package-level default.
|
||||
func SetNodesWithPath(nodeList []string, paths []string) (err error) {
|
||||
|
||||
// Validate if number of nodes is within allowable range.
|
||||
if n != 0 {
|
||||
@@ -50,7 +50,8 @@ func SetNodesWithPath(nodeList []string, path string) (err error) {
|
||||
|
||||
nodes = make([]string, len(nodeList))
|
||||
copy(nodes, nodeList[:])
|
||||
rpcPath = path
|
||||
rpcPaths = make([]string, len(paths))
|
||||
copy(rpcPaths, paths[:])
|
||||
n = len(nodes)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user