mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 20:20:25 +03: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
+1
-2
@@ -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])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
-4
@@ -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
|
||||
}
|
||||
|
||||
Vendored
+3
-3
@@ -98,10 +98,10 @@
|
||||
"revisionTime": "2015-11-18T20:00:48-08:00"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "KCM0UiuvLA5fPiX5I83/HTklxlI=",
|
||||
"checksumSHA1": "r1Vf/vQTkMsZrDVORBGAAIlOMP4=",
|
||||
"path": "github.com/minio/dsync",
|
||||
"revision": "c10eebd6b637bb834d502a6574c53e0ea6c64997",
|
||||
"revisionTime": "2016-08-05T20:56:13Z"
|
||||
"revision": "6bfa8c0c1c37959c1bda15bfdae228a986d3cca8",
|
||||
"revisionTime": "2016-08-07T19:01:27Z"
|
||||
},
|
||||
{
|
||||
"path": "github.com/minio/go-homedir",
|
||||
|
||||
Reference in New Issue
Block a user