diff options
| author | Chris Lu <chris.lu@gmail.com> | 2013-04-14 19:30:26 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2013-04-14 19:30:26 -0700 |
| commit | a4369b35a74752c4fc4005dbdf682401c2fb000c (patch) | |
| tree | 789579d0418ca8753e180a0f0d663a01eed34093 /go/topology/volume_layout.go | |
| parent | 4d8ce2fe26781b070a96f5fa5c6e4906c28016ee (diff) | |
| download | seaweedfs-a4369b35a74752c4fc4005dbdf682401c2fb000c.tar.xz seaweedfs-a4369b35a74752c4fc4005dbdf682401c2fb000c.zip | |
merge changes from about dealing with read only volumes.
https://github.com/tgulacsi/weed-fs/commit/97482255d555f152ea99052aba7d0a0163235e39.diff
Diffstat (limited to 'go/topology/volume_layout.go')
| -rw-r--r-- | go/topology/volume_layout.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/go/topology/volume_layout.go b/go/topology/volume_layout.go index 0791bed20..cd725c132 100644 --- a/go/topology/volume_layout.go +++ b/go/topology/volume_layout.go @@ -39,13 +39,15 @@ func (vl *VolumeLayout) RegisterVolume(v *storage.VolumeInfo, dn *DataNode) { } func (vl *VolumeLayout) isWritable(v *storage.VolumeInfo) bool { - return uint64(v.Size) < vl.volumeSizeLimit && v.Version == storage.CurrentVersion + return uint64(v.Size) < vl.volumeSizeLimit && + v.Version == storage.CurrentVersion && + !v.ReadOnly } func (vl *VolumeLayout) Lookup(vid storage.VolumeId) []*DataNode { - if location := vl.vid2location[vid]; location != nil { - return location.list - } + if location := vl.vid2location[vid]; location != nil { + return location.list + } return nil } |
