From a609a4126c9e2acb322f29e103355c0cd954fd89 Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Tue, 29 Nov 2016 12:33:46 +0530 Subject: [PATCH] Vendorize recent fixes in dsync (#3365) * Update 'i' only if lock grant read from buffered channel --- vendor/github.com/minio/dsync/README.md | 2 +- vendor/github.com/minio/dsync/drwmutex.go | 4 +++- vendor/github.com/minio/dsync/dsync.go | 3 ++- vendor/vendor.json | 6 +++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/vendor/github.com/minio/dsync/README.md b/vendor/github.com/minio/dsync/README.md index 52c7457f0..206e2185c 100644 --- a/vendor/github.com/minio/dsync/README.md +++ b/vendor/github.com/minio/dsync/README.md @@ -16,7 +16,7 @@ This package was developed for the distributed server version of [Minio Object S For [minio](https://minio.io/) the distributed version is started as follows (for a 6-server system): ``` -$ minio server server1/disk server2/disk server3/disk server4/disk server5/disk server6/disk +$ minio server server1:/disk server2:/disk server3:/disk server4:/disk server5:/disk server6:/disk ``` _(note that the same identical command should be run on servers `server1` through to `server6`)_ diff --git a/vendor/github.com/minio/dsync/drwmutex.go b/vendor/github.com/minio/dsync/drwmutex.go index fb75b845a..450c3043b 100644 --- a/vendor/github.com/minio/dsync/drwmutex.go +++ b/vendor/github.com/minio/dsync/drwmutex.go @@ -154,7 +154,7 @@ func (dm *DRWMutex) lockBlocking(isReadLock bool) { // func lock(clnts []RPC, locks *[]string, lockName string, isReadLock bool) bool { - // Create buffered channel of quorum size + // Create buffered channel of size equal to total number of nodes. ch := make(chan Granted, dnodeCount) for index, c := range clnts { @@ -216,6 +216,8 @@ func lock(clnts []RPC, locks *[]string, lockName string, isReadLock bool) bool { // We know that we are not going to get the lock anymore, so exit out // and release any locks that did get acquired done = true + // Increment the number of grants received from the buffered channel. + i++ releaseAll(clnts, locks, lockName, isReadLock) } } diff --git a/vendor/github.com/minio/dsync/dsync.go b/vendor/github.com/minio/dsync/dsync.go index d302e924d..9375e0444 100644 --- a/vendor/github.com/minio/dsync/dsync.go +++ b/vendor/github.com/minio/dsync/dsync.go @@ -34,6 +34,7 @@ var ownNode int // Simple majority based quorum, set to dNodeCount/2+1 var dquorum int + // Simple quorum for read operations, set to dNodeCount/2 var dquorumReads int @@ -59,7 +60,7 @@ func SetNodesWithClients(rpcClnts []RPC, rpcOwnNode int) (err error) { dnodeCount = len(rpcClnts) dquorum = dnodeCount/2 + 1 - dquorumReads = dnodeCount/2 + dquorumReads = dnodeCount / 2 // Initialize node name and rpc path for each RPCClient object. clnts = make([]RPC, dnodeCount) copy(clnts, rpcClnts) diff --git a/vendor/vendor.json b/vendor/vendor.json index 0f640fb84..bf8ceb014 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -111,10 +111,10 @@ "revisionTime": "2015-11-18T20:00:48-08:00" }, { - "checksumSHA1": "UWpLeW+oLfe/MiphMckp1HqKrW0=", + "checksumSHA1": "ddMyebkzU3xB7K8dAhM1S+Mflmo=", "path": "github.com/minio/dsync", - "revision": "fcea3bf5533c1b8a5af3cb377d30363782d2532d", - "revisionTime": "2016-10-15T15:40:54Z" + "revision": "dd0da3743e6668b03559c2905cc661bc0fceeae3", + "revisionTime": "2016-11-28T22:07:34Z" }, { "path": "github.com/minio/go-homedir",