Merge branch 'master' into 13306-arvados-cwl-runner-py3-support
[arvados.git] / services / keep-balance / block_state.go
index 22e89c019ab9fa5a5fb833bf84bbc63df7a4e93b..46e69059c9c796c5b23318f8f9b78b4f3c83651e 100644 (file)
@@ -23,6 +23,7 @@ type Replica struct {
 // replicas actually stored (according to the keepstore indexes we
 // know about).
 type BlockState struct {
+       RefCount int
        Replicas []Replica
        Desired  map[string]int
        // TODO: Support combinations of classes ("private + durable")
@@ -42,6 +43,7 @@ func (bs *BlockState) addReplica(r Replica) {
 }
 
 func (bs *BlockState) increaseDesired(classes []string, n int) {
+       bs.RefCount++
        if len(classes) == 0 {
                classes = defaultClasses
        }