aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/volume_loading.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2025-06-19 01:15:25 -0700
committerchrislu <chris.lu@gmail.com>2025-06-19 01:15:25 -0700
commit2f1b3d68d7f3d4b8684ee37a58938f7af399117c (patch)
treed7b4a1cddb602de3ecd2341a60bf0f067a206763 /weed/storage/volume_loading.go
parent87927d068b02d965f3ea287488942f49f1f4d151 (diff)
downloadseaweedfs-2f1b3d68d7f3d4b8684ee37a58938f7af399117c.tar.xz
seaweedfs-2f1b3d68d7f3d4b8684ee37a58938f7af399117c.zip
pass volume version when creating a volume
Diffstat (limited to 'weed/storage/volume_loading.go')
-rw-r--r--weed/storage/volume_loading.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/storage/volume_loading.go b/weed/storage/volume_loading.go
index 3334159ed..ca690618b 100644
--- a/weed/storage/volume_loading.go
+++ b/weed/storage/volume_loading.go
@@ -16,15 +16,15 @@ import (
"github.com/seaweedfs/seaweedfs/weed/util"
)
-func loadVolumeWithoutIndex(dirname string, collection string, id needle.VolumeId, needleMapKind NeedleMapKind) (v *Volume, err error) {
+func loadVolumeWithoutIndex(dirname string, collection string, id needle.VolumeId, needleMapKind NeedleMapKind, ver needle.Version) (v *Volume, err error) {
v = &Volume{dir: dirname, Collection: collection, Id: id}
v.SuperBlock = super_block.SuperBlock{}
v.needleMapKind = needleMapKind
- err = v.load(false, false, needleMapKind, 0)
+ err = v.load(false, false, needleMapKind, 0, ver)
return
}
-func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind NeedleMapKind, preallocate int64) (err error) {
+func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind NeedleMapKind, preallocate int64, ver needle.Version) (err error) {
alreadyHasSuperBlock := false
hasLoadedVolume := false
@@ -105,7 +105,7 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind
if !v.SuperBlock.Initialized() {
return fmt.Errorf("volume %s not initialized", v.FileName(".dat"))
}
- err = v.maybeWriteSuperBlock()
+ err = v.maybeWriteSuperBlock(ver)
}
if err == nil && alsoLoadIndex {
// adjust for existing volumes with .idx together with .dat files