[ARVADOS] created: 1.2.0-255-ge38d51d61

Git user git at public.curoverse.com
Tue Oct 23 14:38:31 EDT 2018


        at  e38d51d61fb25e5d5c7eb682f3750d44456b0620 (commit)


commit e38d51d61fb25e5d5c7eb682f3750d44456b0620
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Tue Oct 23 14:30:42 2018 -0400

    14388: Don't prefer positions that are only temporarily untrashable.
    
    If old copies exist in the preferred positions, and a new copy is
    written to a worse position, keep the old copies and wait for the new
    copy to become eligible for trash.
    
    Previously, an old copy would be deleted. This would bring replication
    down to the desired level in the short term, but would also cause
    extra pulling/copying in the future to restore the optimal copy, and
    introduce extra probes for all clients in the meantime.
    
    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 6bfd17573..7683835dd 100644
--- a/services/keep-balance/balance.go
+++ b/services/keep-balance/balance.go
@@ -520,7 +520,7 @@ func (bal *Balancer) balanceBlock(blkid arvados.SizedDigest, blk *BlockState) ba
 			slots = append(slots, slot{
 				mnt:  mnt,
 				repl: repl,
-				want: repl != nil && (mnt.ReadOnly || repl.Mtime >= bal.MinMtime),
+				want: repl != nil && mnt.ReadOnly,
 			})
 		}
 	}
@@ -716,7 +716,7 @@ func (bal *Balancer) balanceBlock(blkid arvados.SizedDigest, blk *BlockState) ba
 		// TODO: request a Touch if Mtime is duplicated.
 		var change int
 		switch {
-		case !underreplicated && slot.repl != nil && !slot.want && !unsafeToDelete[slot.repl.Mtime]:
+		case !underreplicated && !slot.want && slot.repl != nil && slot.repl.Mtime < bal.MinMtime && !unsafeToDelete[slot.repl.Mtime]:
 			slot.mnt.KeepService.AddTrash(Trash{
 				SizedDigest: blkid,
 				Mtime:       slot.repl.Mtime,
diff --git a/services/keep-balance/balance_test.go b/services/keep-balance/balance_test.go
index 2e664bedf..37be185dc 100644
--- a/services/keep-balance/balance_test.go
+++ b/services/keep-balance/balance_test.go
@@ -238,7 +238,14 @@ func (bal *balancerSuite) TestDecreaseReplBlockTooNew(c *check.C) {
 	bal.try(c, tester{
 		desired:    map[string]int{"default": 2},
 		current:    slots{0, 1, 2},
-		timestamps: []int64{oldTime, newTime, newTime + 1}})
+		timestamps: []int64{oldTime, newTime, newTime + 1},
+		expectResult: balanceResult{
+			have: 3,
+			want: 2,
+			classState: map[string]balancedBlockState{"default": {
+				desired:      2,
+				surplus:      1,
+				unachievable: false}}}})
 	// The best replicas are too new to delete, but the excess
 	// replica is old enough.
 	bal.try(c, tester{

commit 33af4962460b99718e26e9c22b6e8cae1a19d253
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Tue Oct 23 14:28:39 2018 -0400

    14388: Fix typo.
    
    Condition (si.want != si.want) should have been (si.want != sj.want).
    
    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 8a06b902f..6bfd17573 100644
--- a/services/keep-balance/balance.go
+++ b/services/keep-balance/balance.go
@@ -568,14 +568,14 @@ func (bal *Balancer) balanceBlock(blkid arvados.SizedDigest, blk *BlockState) ba
 				// Prefer a mount that satisfies the
 				// desired class.
 				return bal.mountsByClass[class][si.mnt]
-			} else if wanti, wantj := si.want, si.want; wanti != wantj {
+			} else if si.want != sj.want {
 				// Prefer a mount that will have a
 				// replica no matter what we do here
 				// -- either because it already has an
 				// untrashable replica, or because we
 				// already need it to satisfy a
 				// different storage class.
-				return slots[i].want
+				return si.want
 			} else if orderi, orderj := srvRendezvous[si.mnt.KeepService], srvRendezvous[sj.mnt.KeepService]; orderi != orderj {
 				// Prefer a better rendezvous
 				// position.

commit 59ec2a36cd613ff9274da288c04a39dd019659eb
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Tue Oct 23 14:25:37 2018 -0400

    14388: Fix log message.
    
    When a volume with replication=2 has 15 objects, report them as "15
    entries / 2x / 30 replicas", rather than "15 replicas", so the numbers
    agree with the other logs/stats about replica counts.
    
    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 5f5f9afdc..8a06b902f 100644
--- a/services/keep-balance/balance.go
+++ b/services/keep-balance/balance.go
@@ -308,9 +308,9 @@ func (bal *Balancer) GetCurrentState(c *arvados.Client, pageSize, bufs int) erro
 				return
 			}
 			for _, mount := range mounts {
-				bal.logf("%s: add %d replicas to map", mount, len(idx))
+				bal.logf("%s: add %d entries to map", mount, len(idx))
 				bal.BlockStateMap.AddReplicas(mount, idx)
-				bal.logf("%s: added %d replicas", mount, len(idx))
+				bal.logf("%s: added %d entries to map at %dx (%d replicas)", mount, len(idx), mount.Replication, len(idx)*mount.Replication)
 			}
 			bal.logf("mount %s: index done", mounts[0])
 		}(mounts)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list