aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/volume_loading.go
diff options
context:
space:
mode:
authorBruce <half-life@jibudata.com>2024-09-05 22:58:24 +0800
committerGitHub <noreply@github.com>2024-09-05 07:58:24 -0700
commitf9e141a4126c3e243edb46b84bc3649a7e790bc8 (patch)
treec093eb3d7a5b016cad90e44e3f116d78ae09a386 /weed/storage/volume_loading.go
parent310d41998d0292654f8d05e02fea2a5fd90d8bc3 (diff)
downloadseaweedfs-f9e141a4126c3e243edb46b84bc3649a7e790bc8.tar.xz
seaweedfs-f9e141a4126c3e243edb46b84bc3649a7e790bc8.zip
persist readonly state to volume info (#5977)
Diffstat (limited to 'weed/storage/volume_loading.go')
-rw-r--r--weed/storage/volume_loading.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/weed/storage/volume_loading.go b/weed/storage/volume_loading.go
index 077ce43c6..7064fdc03 100644
--- a/weed/storage/volume_loading.go
+++ b/weed/storage/volume_loading.go
@@ -43,6 +43,11 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind
hasVolumeInfoFile := v.maybeLoadVolumeInfo()
+ if v.volumeInfo.ReadOnly && !v.HasRemoteFile() {
+ // this covers the case where the volume is marked as read-only and has no remote file
+ v.noWriteOrDelete = true
+ }
+
if v.HasRemoteFile() {
v.noWriteCanDelete = true
v.noWriteOrDelete = false