[ARVADOS] updated: 1.1.4-383-g8fa5733

Git user git at public.curoverse.com
Mon Jun 11 17:02:03 EDT 2018


Summary of changes:
 services/keep-balance/balance.go | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

       via  8fa57330875af11b7b61dfac6fc45080760afdf2 (commit)
      from  06eb98871e82074b935d9da201118119e5719f96 (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 8fa57330875af11b7b61dfac6fc45080760afdf2
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Mon Jun 11 17:01:38 2018 -0400

    13407: Fix stats reporting for mounts with replication>1.
    
    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 d1c567f..d86234a 100644
--- a/services/keep-balance/balance.go
+++ b/services/keep-balance/balance.go
@@ -562,7 +562,7 @@ func (bal *Balancer) balanceBlock(blkid arvados.SizedDigest, blk *BlockState) ba
 		have := 0
 		for _, slot := range slots {
 			if slot.repl != nil && bal.mountsByClass[class][slot.mnt] && !countedDev[slot.mnt.DeviceID] {
-				have++
+				have += slot.mnt.Replication
 				if slot.mnt.DeviceID != "" {
 					countedDev[slot.mnt.DeviceID] = true
 				}
@@ -713,14 +713,17 @@ func (bal *Balancer) balanceBlock(blkid arvados.SizedDigest, blk *BlockState) ba
 	countedDev := map[string]bool{}
 	var have, want int
 	for _, slot := range slots {
+		if countedDev[slot.mnt.DeviceID] {
+			continue
+		}
 		if slot.want {
-			want++
+			want += slot.mnt.Replication
 		}
-		if slot.repl != nil && !countedDev[slot.mnt.DeviceID] {
-			have++
-			if slot.mnt.DeviceID != "" {
-				countedDev[slot.mnt.DeviceID] = true
-			}
+		if slot.repl != nil {
+			have += slot.mnt.Replication
+		}
+		if slot.mnt.DeviceID != "" {
+			countedDev[slot.mnt.DeviceID] = true
 		}
 	}
 
@@ -862,7 +865,7 @@ func (bal *Balancer) collectStatistics(results <-chan balanceResult) {
 		case surplus > 0:
 			s.overrep.replicas += surplus
 			s.overrep.blocks++
-			s.overrep.bytes += bytes * int64(len(result.blk.Replicas)-result.want)
+			s.overrep.bytes += bytes * int64(result.have-result.want)
 		default:
 			s.justright.replicas += result.want
 			s.justright.blocks++
@@ -874,16 +877,16 @@ func (bal *Balancer) collectStatistics(results <-chan balanceResult) {
 			s.desired.blocks++
 			s.desired.bytes += bytes * int64(result.want)
 		}
-		if len(result.blk.Replicas) > 0 {
-			s.current.replicas += len(result.blk.Replicas)
+		if result.have > 0 {
+			s.current.replicas += result.have
 			s.current.blocks++
-			s.current.bytes += bytes * int64(len(result.blk.Replicas))
+			s.current.bytes += bytes * int64(result.have)
 		}
 
-		for len(s.replHistogram) <= len(result.blk.Replicas) {
+		for len(s.replHistogram) <= result.have {
 			s.replHistogram = append(s.replHistogram, 0)
 		}
-		s.replHistogram[len(result.blk.Replicas)]++
+		s.replHistogram[result.have]++
 	}
 	for _, srv := range bal.KeepServices {
 		s.pulls += len(srv.ChangeSet.Pulls)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list