[ARVADOS] updated: 1.1.4-365-g1714431

Git user git at public.curoverse.com
Wed Jun 6 15:26:03 EDT 2018


Summary of changes:
 build/run-tests.sh                    | 11 ++++++++---
 services/keep-balance/balance.go      | 12 ++++++++++--
 services/keep-balance/balance_test.go | 34 ++++++++++++++++++++++++++++++----
 3 files changed, 48 insertions(+), 9 deletions(-)

       via  1714431955ac7b2a1d2fd3c2cda9b806bad624cb (commit)
       via  da2cfffb3a3ec92c3b15841255dc704a99748fea (commit)
      from  c9143544609d90da33eb3c2d566fc5d6a25188b2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 1714431955ac7b2a1d2fd3c2cda9b806bad624cb
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Wed Jun 6 15:25:45 2018 -0400

    13427: More symlink hack
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/build/run-tests.sh b/build/run-tests.sh
index 1b6e4f1..7d3646c 100755
--- a/build/run-tests.sh
+++ b/build/run-tests.sh
@@ -514,12 +514,17 @@ export GOPATH
     set -e
     mkdir -p "$GOPATH/src/git.curoverse.com"
     rmdir -v --parents --ignore-fail-on-non-empty "${temp}/GOPATH"
+    if [[ ! -h "$GOPATH/src/git.curoverse.com/arvados.git" ]]; then
+        for d in \
+            "$GOPATH/src/git.curoverse.com/arvados.git/tmp/GOPATH" \
+                "$GOPATH/src/git.curoverse.com/arvados.git/tmp" \
+                "$GOPATH/src/git.curoverse.com/arvados.git"; do
+            [[ -d "$d" ]] && rmdir "$d"
+        done
+    fi
     for d in \
-        "$GOPATH/src/git.curoverse.com/arvados.git/tmp/GOPATH" \
-        "$GOPATH/src/git.curoverse.com/arvados.git/tmp" \
         "$GOPATH/src/git.curoverse.com/arvados.git/arvados" \
         "$GOPATH/src/git.curoverse.com/arvados.git"; do
-        [[ -d "$d" ]] && rmdir "$d"
         [[ -h "$d" ]] && rm "$d"
     done
     ln -vsfT "$WORKSPACE" "$GOPATH/src/git.curoverse.com/arvados.git"

commit da2cfffb3a3ec92c3b15841255dc704a99748fea
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Wed Jun 6 15:19:35 2018 -0400

    13427: Fix replication stats reporting for multiple-mounted devices.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/services/keep-balance/balance.go b/services/keep-balance/balance.go
index 5aad8e6..328e623 100644
--- a/services/keep-balance/balance.go
+++ b/services/keep-balance/balance.go
@@ -528,10 +528,14 @@ func (bal *Balancer) balanceBlock(blkid arvados.SizedDigest, blk *BlockState) ba
 	for _, class := range bal.classes {
 		desired := blk.Desired[class]
 
+		countedDev := map[string]bool{}
 		have := 0
 		for _, slot := range slots {
-			if slot.repl != nil && bal.mountsByClass[class][slot.mnt] {
+			if slot.repl != nil && bal.mountsByClass[class][slot.mnt] && !countedDev[slot.mnt.DeviceID] {
 				have++
+				if slot.mnt.DeviceID != "" {
+					countedDev[slot.mnt.DeviceID] = true
+				}
 			}
 		}
 		classState[class] = balancedBlockState{
@@ -670,13 +674,17 @@ func (bal *Balancer) balanceBlock(blkid arvados.SizedDigest, blk *BlockState) ba
 	// replica that doesn't have a timestamp collision with
 	// others.
 
+	countedDev := map[string]bool{}
 	var have, want int
 	for _, slot := range slots {
 		if slot.want {
 			want++
 		}
-		if slot.repl != nil {
+		if slot.repl != nil && !countedDev[slot.mnt.DeviceID] {
 			have++
+			if slot.mnt.DeviceID != "" {
+				countedDev[slot.mnt.DeviceID] = true
+			}
 		}
 	}
 
diff --git a/services/keep-balance/balance_test.go b/services/keep-balance/balance_test.go
index 602c42e..8650de1 100644
--- a/services/keep-balance/balance_test.go
+++ b/services/keep-balance/balance_test.go
@@ -49,6 +49,8 @@ type tester struct {
 
 	shouldPullMounts  []string
 	shouldTrashMounts []string
+
+	expectResult balanceResult
 }
 
 func (bal *balancerSuite) SetUpSuite(c *check.C) {
@@ -292,14 +294,26 @@ func (bal *balancerSuite) TestDeviceRWMountedByMultipleServers(c *check.C) {
 		known:      0,
 		desired:    map[string]int{"default": 2},
 		current:    slots{1, 9},
-		shouldPull: slots{0}})
+		shouldPull: slots{0},
+		expectResult: balanceResult{
+			have: 1,
+			classState: map[string]balancedBlockState{"default": {
+				desired:      2,
+				surplus:      -1,
+				unachievable: false}}}})
 	// block 0 is overreplicated, but the second and third
 	// replicas are the same replica according to DeviceID
 	// (despite different Mtimes). Don't trash the third replica.
 	bal.try(c, tester{
 		known:   0,
 		desired: map[string]int{"default": 2},
-		current: slots{0, 1, 9}})
+		current: slots{0, 1, 9},
+		expectResult: balanceResult{
+			have: 2,
+			classState: map[string]balancedBlockState{"default": {
+				desired:      2,
+				surplus:      0,
+				unachievable: false}}}})
 	// block 0 is overreplicated; the third and fifth replicas are
 	// extra, but the fourth is another view of the second and
 	// shouldn't be trashed.
@@ -307,7 +321,13 @@ func (bal *balancerSuite) TestDeviceRWMountedByMultipleServers(c *check.C) {
 		known:       0,
 		desired:     map[string]int{"default": 2},
 		current:     slots{0, 1, 5, 9, 12},
-		shouldTrash: slots{5, 12}})
+		shouldTrash: slots{5, 12},
+		expectResult: balanceResult{
+			have: 4,
+			classState: map[string]balancedBlockState{"default": {
+				desired:      2,
+				surplus:      2,
+				unachievable: false}}}})
 }
 
 func (bal *balancerSuite) TestChangeStorageClasses(c *check.C) {
@@ -438,7 +458,7 @@ func (bal *balancerSuite) try(c *check.C, t tester) {
 	for _, srv := range bal.srvs {
 		srv.ChangeSet = &ChangeSet{}
 	}
-	bal.balanceBlock(knownBlkid(t.known), blk)
+	result := bal.balanceBlock(knownBlkid(t.known), blk)
 
 	var didPull, didTrash slots
 	var didPullMounts, didTrashMounts []string
@@ -474,6 +494,12 @@ func (bal *balancerSuite) try(c *check.C, t tester) {
 		sort.Strings(didTrashMounts)
 		c.Check(didTrashMounts, check.DeepEquals, t.shouldTrashMounts)
 	}
+	if t.expectResult.have > 0 {
+		c.Check(result.have, check.Equals, t.expectResult.have)
+	}
+	if t.expectResult.classState != nil {
+		c.Check(result.classState, check.DeepEquals, t.expectResult.classState)
+	}
 }
 
 // srvList returns the KeepServices, sorted in rendezvous order and

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list