From 8e96f8cacd728b1a1b4316ecb2fb7cd233a97144 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Thu, 22 Mar 2018 12:58:57 -0400 Subject: [PATCH] 7931: Don't bother trying to trash replicas on readonly mounts. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- services/keep-balance/balance.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/services/keep-balance/balance.go b/services/keep-balance/balance.go index d87e2a29f9..9338075d01 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] { -- 2.30.2