diff --git a/cmd/endpoint_test.go b/cmd/endpoint_test.go index d9c849589..a03b8d81d 100644 --- a/cmd/endpoint_test.go +++ b/cmd/endpoint_test.go @@ -108,7 +108,7 @@ func TestNewEndpointList(t *testing.T) { {[]string{"d1", "d2", "d3", "d1"}, fmt.Errorf("duplicate endpoints found")}, {[]string{"d1", "d2", "d3", "./d1"}, fmt.Errorf("duplicate endpoints found")}, {[]string{"http://localhost/d1", "http://localhost/d2", "http://localhost/d1", "http://localhost/d4"}, fmt.Errorf("duplicate endpoints found")}, - {[]string{"d1", "d2", "d3", "d4", "d5"}, fmt.Errorf("A total of 5 endpoints were found. For erasure mode it should be an even number between 4 and 16")}, + {[]string{"d1", "d2", "d3", "d4", "d5"}, fmt.Errorf("A total of 5 endpoints were found. For erasure mode it should be an even number between 4 and 32")}, {[]string{"ftp://server/d1", "http://server/d2", "http://server/d3", "http://server/d4"}, fmt.Errorf("'ftp://server/d1': invalid URL endpoint format")}, {[]string{"d1", "http://localhost/d2", "d3", "d4"}, fmt.Errorf("mixed style endpoints are not supported")}, {[]string{"http://example.org/d1", "https://example.com/d1", "http://example.net/d1", "https://example.edut/d1"}, fmt.Errorf("mixed scheme is not supported")}, diff --git a/cmd/xl-v1.go b/cmd/xl-v1.go index 653744873..6e7ba7e6f 100644 --- a/cmd/xl-v1.go +++ b/cmd/xl-v1.go @@ -1,5 +1,5 @@ /* - * Minio Cloud Storage, (C) 2016 Minio, Inc. + * Minio Cloud Storage, (C) 2016, 2017, 2018 Minio, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ const ( uploadsJSONFile = "uploads.json" // Maximum erasure blocks. - maxErasureBlocks = 16 + maxErasureBlocks = 32 // Minimum erasure blocks. minErasureBlocks = 4 @@ -51,6 +51,7 @@ type xlObjects struct { // name space mutex for object layer nsMutex *nsLockMap + // Variable represents bucket policies in memory. bucketPolicies *bucketPolicies } diff --git a/vendor/github.com/minio/dsync/dsync.go b/vendor/github.com/minio/dsync/dsync.go index f88438ab5..b717c868a 100644 --- a/vendor/github.com/minio/dsync/dsync.go +++ b/vendor/github.com/minio/dsync/dsync.go @@ -18,6 +18,7 @@ package dsync import ( "errors" + "math" ) // Dsync represents dsync client object which is initialized with @@ -41,12 +42,10 @@ type Dsync struct { // New - initializes a new dsync object with input rpcClnts. func New(rpcClnts []NetLocker, rpcOwnNode int) (*Dsync, error) { - if len(rpcClnts) < 4 { - return nil, errors.New("Dsync is not designed for less than 4 nodes") - } else if len(rpcClnts) > 16 { - return nil, errors.New("Dsync is not designed for more than 16 nodes") - } else if len(rpcClnts)%2 != 0 { - return nil, errors.New("Dsync is not designed for an uneven number of nodes") + if len(rpcClnts) < 2 { + return nil, errors.New("Dsync is not designed for less than 2 nodes") + } else if len(rpcClnts) > 32 { + return nil, errors.New("Dsync is not designed for more than 32 nodes") } if rpcOwnNode > len(rpcClnts) { @@ -55,8 +54,10 @@ func New(rpcClnts []NetLocker, rpcOwnNode int) (*Dsync, error) { ds := &Dsync{} ds.dNodeCount = len(rpcClnts) - ds.dquorum = ds.dNodeCount/2 + 1 - ds.dquorumReads = ds.dNodeCount / 2 + + // With odd number of nodes, write and read quorum is basically the same + ds.dquorum = int(ds.dNodeCount/2) + 1 + ds.dquorumReads = int(math.Ceil(float64(ds.dNodeCount) / 2.0)) ds.ownNode = rpcOwnNode // Initialize node name and rpc path for each NetLocker object. diff --git a/vendor/vendor.json b/vendor/vendor.json index 460f54194..3befc707b 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -380,10 +380,10 @@ "revisionTime": "2017-02-27T07:32:28Z" }, { - "checksumSHA1": "qhWQM7xmqaxFqADNTj8YPjE/8Ws=", + "checksumSHA1": "1AQVDkFvVxn1RMTLyjeDSESBhrc=", "path": "github.com/minio/dsync", - "revision": "ed0989bc6c7b199f749fa6be0b7ee98d689b88c7", - "revisionTime": "2017-11-22T09:16:00Z" + "revision": "439a0961af700f80db84cc180fe324a89070fa65", + "revisionTime": "2018-01-23T12:12:34Z" }, { "path": "github.com/minio/go-homedir",