dedup keeps the largest replica

This commit is contained in:
Chris Lu 2021-08-10 12:30:41 -07:00
parent 0526db12e2
commit b63b042afc

View file

@ -412,14 +412,14 @@ func pickOneReplicaToDelete(replicas []*VolumeReplica, replicaPlacement *super_b
sort.Slice(replicas, func(i, j int) bool {
a, b := replicas[i], replicas[j]
if a.info.CompactRevision != b.info.CompactRevision {
return a.info.CompactRevision < b.info.CompactRevision
if a.info.Size != b.info.Size {
return a.info.Size < b.info.Size
}
if a.info.ModifiedAtSecond != b.info.ModifiedAtSecond {
return a.info.ModifiedAtSecond < b.info.ModifiedAtSecond
}
if a.info.Size != b.info.Size {
return a.info.Size < b.info.Size
if a.info.CompactRevision != b.info.CompactRevision {
return a.info.CompactRevision < b.info.CompactRevision
}
return false
})