aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_volume_balance_test.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2024-04-15 20:09:14 -0700
committerchrislu <chris.lu@gmail.com>2024-04-15 20:09:14 -0700
commitce2b2fa9b268288abc4e83f208ce1487838eb414 (patch)
treea3b0304c2836dc9fb743dfaf73a97c3d8092823d /weed/shell/command_volume_balance_test.go
parent68ade92d4f2a205dee1f7e9ee84cabeb81c68147 (diff)
parent37019477bc68f0f3ed83e39034b455622b35b383 (diff)
downloadseaweedfs-ce2b2fa9b268288abc4e83f208ce1487838eb414.tar.xz
seaweedfs-ce2b2fa9b268288abc4e83f208ce1487838eb414.zip
Merge branch 'master' into mq-subscribe
Diffstat (limited to 'weed/shell/command_volume_balance_test.go')
-rw-r--r--weed/shell/command_volume_balance_test.go19
1 files changed, 17 insertions, 2 deletions
diff --git a/weed/shell/command_volume_balance_test.go b/weed/shell/command_volume_balance_test.go
index d533269a4..b8af4fb98 100644
--- a/weed/shell/command_volume_balance_test.go
+++ b/weed/shell/command_volume_balance_test.go
@@ -1,10 +1,10 @@
package shell
import (
- "testing"
-
+ "fmt"
"github.com/seaweedfs/seaweedfs/weed/storage/types"
"github.com/stretchr/testify/assert"
+ "testing"
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"github.com/seaweedfs/seaweedfs/weed/storage/super_block"
@@ -271,3 +271,18 @@ func TestVolumeSelection(t *testing.T) {
assert.Equal(t, 378, len(vids))
}
+
+func TestDeleteEmptySelection(t *testing.T) {
+ topologyInfo := parseOutput(topoData)
+
+ eachDataNode(topologyInfo, func(dc string, rack RackId, dn *master_pb.DataNodeInfo) {
+ for _, diskInfo := range dn.DiskInfos {
+ for _, v := range diskInfo.VolumeInfos {
+ if v.Size <= super_block.SuperBlockSize && v.ModifiedAtSecond > 0 {
+ fmt.Printf("empty volume %d from %s\n", v.Id, dn.Id)
+ }
+ }
+ }
+ })
+
+}