[ARVADOS] updated: 1.1.3-225-g41e612b

Git user git at public.curoverse.com
Thu Mar 22 13:22:00 EDT 2018


Summary of changes:
 services/keep-balance/balance.go | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

       via  41e612b59ad85ee7f22ebf3239ec8ff1cbb463c5 (commit)
       via  8e96f8cacd728b1a1b4316ecb2fb7cd233a97144 (commit)
      from  741acb186f89237011fd7bf371218246d7f85403 (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 41e612b59ad85ee7f22ebf3239ec8ff1cbb463c5
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Thu Mar 22 13:20:32 2018 -0400

    7931: OTBE, prefer readonly replicas; they can't be trashed anyway.
    
    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 9338075..32f36e0 100644
--- a/services/keep-balance/balance.go
+++ b/services/keep-balance/balance.go
@@ -429,11 +429,21 @@ func (bal *Balancer) balanceBlock(blkid arvados.SizedDigest, blk *BlockState) {
 		rendezvousOrder[srv] = i
 		slots[i].srv = srv
 	}
+
+	// Sort readonly replicas ahead of trashable ones. This way,
+	// if a single service has excessive replicas, the ones we
+	// encounter last (and therefore choose to delete) will be on
+	// the writable volumes, where possible.
+	//
+	// TODO: within the trashable set, prefer the oldest replica
+	// that doesn't have a timestamp collision with others.
+	sort.Slice(blk.Replicas, func(i, j int) bool {
+		mnt := blk.Replicas[i].KeepMount
+		return mnt.ReadOnly || mnt.KeepService.ReadOnly
+	})
+
+	// Assign existing replicas to slots.
 	for ri := range blk.Replicas {
-		// TODO: when multiple copies are on one server,
-		// prefer one on a readonly mount, or the oldest one
-		// that doesn't have a timestamp collision with other
-		// replicas.
 		repl := &blk.Replicas[ri]
 		srv := repl.KeepService
 		slotIdx := rendezvousOrder[srv]

commit 8e96f8cacd728b1a1b4316ecb2fb7cd233a97144
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Thu Mar 22 12:58:57 2018 -0400

    7931: Don't bother trying to trash replicas on readonly mounts.
    
    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 d87e2a2..9338075 100644
--- a/services/keep-balance/balance.go
+++ b/services/keep-balance/balance.go
@@ -430,9 +430,10 @@ func (bal *Balancer) balanceBlock(blkid arvados.SizedDigest, blk *BlockState) {
 		slots[i].srv = srv
 	}
 	for ri := range blk.Replicas {
-		// TODO: when multiple copies are on one server, use
-		// the oldest one that doesn't have a timestamp
-		// collision with other replicas.
+		// TODO: when multiple copies are on one server,
+		// prefer one on a readonly mount, or the oldest one
+		// that doesn't have a timestamp collision with other
+		// replicas.
 		repl := &blk.Replicas[ri]
 		srv := repl.KeepService
 		slotIdx := rendezvousOrder[srv]
@@ -475,6 +476,7 @@ func (bal *Balancer) balanceBlock(blkid arvados.SizedDigest, blk *BlockState) {
 			// distinct from all of the better replicas'
 			// Mtimes.
 			if !srv.ReadOnly &&
+				!repl.KeepMount.ReadOnly &&
 				repl.Mtime < bal.MinMtime &&
 				len(uniqueBestRepl) >= blk.Desired &&
 				!uniqueBestRepl[repl.Mtime] {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list