Skip to content

Commit

Permalink
Storage selector fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Karasiq committed Apr 17, 2020
1 parent 6223bfe commit 9029c98
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class SimpleStorageSelector(region: RegionContext) extends StorageSelector {
chunk.writeStatus match {
case WriteStatus.Pending(affinity)
val newList = affinity.mandatory.filterNot(chunk.availability.isFailed) ++ generatedList
affinity.copy(mandatory = (selectStoragesToWrite(newList) ++ settings.writeInclude).distinct)
affinity.copy(mandatory = (selectStoragesToWrite(newList)).distinct)

case _
ChunkWriteAffinity(selectStoragesToWrite(generatedList))
Expand All @@ -75,6 +75,6 @@ class SimpleStorageSelector(region: RegionContext) extends StorageSelector {
}

protected def selectStoragesToWrite(storages: Seq[StorageId]): Seq[StorageId] = {
Utils.takeOrAll(sortStorages(storages.distinct), settings.dataRF)
Utils.takeOrAll(sortStorages(storages.filterNot(settings.writeInclude).distinct), settings.dataRF) ++ settings.writeInclude
}
}

0 comments on commit 9029c98

Please sign in to comment.