mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
dedup keeps the largest replica
This commit is contained in:
parent
0526db12e2
commit
b63b042afc
|
@ -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
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue