aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2023-10-03 08:15:18 -0700
committerchrislu <chris.lu@gmail.com>2023-10-03 08:15:18 -0700
commit451ec6504d07812b074555a1fbb2a831bfa8e5e3 (patch)
tree636916fb97379b46befdf46771892a574118b0ce
parentf9abfd0b03b67e3fa876fcacf584edf378164eb9 (diff)
downloadseaweedfs-451ec6504d07812b074555a1fbb2a831bfa8e5e3.tar.xz
seaweedfs-451ec6504d07812b074555a1fbb2a831bfa8e5e3.zip
fix compilation
-rw-r--r--weed/storage/disk_location.go1
-rw-r--r--weed/storage/erasure_coding/ec_shard.go2
-rw-r--r--weed/storage/store.go1
-rw-r--r--weed/storage/volume_loading.go3
4 files changed, 2 insertions, 5 deletions
diff --git a/weed/storage/disk_location.go b/weed/storage/disk_location.go
index b7fa82197..377189c56 100644
--- a/weed/storage/disk_location.go
+++ b/weed/storage/disk_location.go
@@ -177,6 +177,7 @@ func (l *DiskLocation) loadExistingVolume(dirEntry os.DirEntry, needleMapKind Ne
}
l.SetVolume(vid, v)
+ stats.VolumeServerVolumeCounter.WithLabelValues(v.Collection, "volume", v.DiskType().ReadableString()).Inc()
size, _, _ := v.FileStat()
glog.V(0).Infof("data file %s, replication=%s v=%d size=%d ttl=%s",
diff --git a/weed/storage/erasure_coding/ec_shard.go b/weed/storage/erasure_coding/ec_shard.go
index 85694e63b..08a50ebf7 100644
--- a/weed/storage/erasure_coding/ec_shard.go
+++ b/weed/storage/erasure_coding/ec_shard.go
@@ -7,8 +7,6 @@ import (
"strconv"
"strings"
- "github.com/seaweedfs/seaweedfs/weed/storage/types"
-
"github.com/seaweedfs/seaweedfs/weed/stats"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
"github.com/seaweedfs/seaweedfs/weed/storage/types"
diff --git a/weed/storage/store.go b/weed/storage/store.go
index 6b4467abc..9e8f30d99 100644
--- a/weed/storage/store.go
+++ b/weed/storage/store.go
@@ -167,6 +167,7 @@ func (s *Store) addVolume(vid needle.VolumeId, collection string, needleMapKind
location.Directory, vid, collection, replicaPlacement, ttl)
if volume, err := NewVolume(location.Directory, location.IdxDirectory, collection, vid, needleMapKind, replicaPlacement, ttl, preallocate, memoryMapMaxSizeMb, ldbTimeout); err == nil {
location.SetVolume(vid, volume)
+ stats.VolumeServerVolumeCounter.WithLabelValues(volume.Collection, "volume", volume.DiskType().ReadableString()).Inc()
glog.V(0).Infof("add volume %d", vid)
s.NewVolumesChan <- master_pb.VolumeShortInformationMessage{
Id: uint32(vid),
diff --git a/weed/storage/volume_loading.go b/weed/storage/volume_loading.go
index e7018d52c..d7ed0acb0 100644
--- a/weed/storage/volume_loading.go
+++ b/weed/storage/volume_loading.go
@@ -9,7 +9,6 @@ import (
"github.com/syndtr/goleveldb/leveldb/opt"
"github.com/seaweedfs/seaweedfs/weed/glog"
- "github.com/seaweedfs/seaweedfs/weed/stats"
"github.com/seaweedfs/seaweedfs/weed/storage/backend"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
"github.com/seaweedfs/seaweedfs/weed/storage/super_block"
@@ -201,8 +200,6 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind
}
}
- stats.VolumeServerVolumeCounter.WithLabelValues(v.Collection, "volume", v.DiskType().ReadableString()).Inc()
-
if err == nil {
hasLoadedVolume = true
}