aboutsummaryrefslogtreecommitdiff
path: root/go/topology/volume_layout.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/topology/volume_layout.go')
-rw-r--r--go/topology/volume_layout.go10
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
}