Browse Source

fix EcVolumes sorting in volume UI (#6275)

* Update store_ec.go

* fix: EcVolume sorting not work

* use stdlib

* revert
pull/6277/head
Trim21 4 weeks ago
committed by GitHub
parent
commit
fd6c787c02
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 7
      weed/storage/store_ec.go

7
weed/storage/store_ec.go

@ -3,13 +3,14 @@ package storage
import (
"context"
"fmt"
"github.com/seaweedfs/seaweedfs/weed/pb"
"golang.org/x/exp/slices"
"io"
"os"
"slices"
"sync"
"time"
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/klauspost/reedsolomon"
"github.com/seaweedfs/seaweedfs/weed/glog"
@ -405,7 +406,7 @@ func (s *Store) EcVolumes() (ecVolumes []*erasure_coding.EcVolume) {
location.ecVolumesLock.RUnlock()
}
slices.SortFunc(ecVolumes, func(a, b *erasure_coding.EcVolume) int {
return int(b.VolumeId - a.VolumeId)
return int(a.VolumeId) - int(b.VolumeId)
})
return ecVolumes
}
Loading…
Cancel
Save