diff --git a/weed/topology/configuration.go b/weed/topology/configuration.go index d9fde4a04..27aba76ca 100644 --- a/weed/topology/configuration.go +++ b/weed/topology/configuration.go @@ -4,10 +4,6 @@ import ( "encoding/xml" ) -type loc struct { - dcName string - rackName string -} type rack struct { Name string `xml:"name,attr"` Ips []string `xml:"Ip"` diff --git a/weed/topology/volume_growth_reservation_test.go b/weed/topology/volume_growth_reservation_test.go index a29d924bd..f3711b2fa 100644 --- a/weed/topology/volume_growth_reservation_test.go +++ b/weed/topology/volume_growth_reservation_test.go @@ -7,7 +7,6 @@ import ( "time" "github.com/seaweedfs/seaweedfs/weed/sequence" - "github.com/seaweedfs/seaweedfs/weed/storage/needle" "github.com/seaweedfs/seaweedfs/weed/storage/super_block" "github.com/seaweedfs/seaweedfs/weed/storage/types" ) @@ -15,13 +14,6 @@ import ( // MockGrpcDialOption simulates grpc connection for testing type MockGrpcDialOption struct{} -// simulateVolumeAllocation mocks the volume allocation process -func simulateVolumeAllocation(server *DataNode, vid needle.VolumeId, option *VolumeGrowOption) error { - // Simulate some processing time - time.Sleep(time.Millisecond * 10) - return nil -} - func TestVolumeGrowth_ReservationBasedAllocation(t *testing.T) { // Create test topology with single server for predictable behavior topo := NewTopology("weedfs", sequence.NewMemorySequencer(), 32*1024, 5, false) diff --git a/weed/topology/volume_layout.go b/weed/topology/volume_layout.go index 48e75ec82..b25097e71 100644 --- a/weed/topology/volume_layout.go +++ b/weed/topology/volume_layout.go @@ -156,7 +156,7 @@ func NewVolumeLayout(rp *super_block.ReplicaPlacement, ttl *needle.TTL, diskType vacuumedVolumes: make(map[needle.VolumeId]time.Time), volumeSizeLimit: volumeSizeLimit, replicationAsMin: replicationAsMin, - sizeTracking: make(map[needle.VolumeId]*volumeSizeTracking), + sizeTracking: make(map[needle.VolumeId]*volumeSizeTracking), } } @@ -362,10 +362,6 @@ func (vl *VolumeLayout) isOversized(v *storage.VolumeInfo) bool { return uint64(v.Size) >= vl.volumeSizeLimit } -func (vl *VolumeLayout) isCrowdedVolume(v *storage.VolumeInfo) bool { - return float64(v.Size) > float64(vl.volumeSizeLimit)*VolumeGrowStrategy.Threshold -} - // RecordAssign adds the estimated byte size to the volume's tracked effective // size and updates the volume's writable state: // @@ -489,7 +485,6 @@ func (vl *VolumeLayout) DrainAndRemoveFromWritable(vid needle.VolumeId) { vl.waitForPendingDrain(context.Background(), vid) } - func (vl *VolumeLayout) isEmpty() bool { vl.accessLock.RLock() defer vl.accessLock.RUnlock()