aboutsummaryrefslogtreecommitdiff
path: root/weed/topology/data_node_ec.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-05-26 00:49:15 -0700
committerChris Lu <chris.lu@gmail.com>2019-05-26 00:49:15 -0700
commitb58e25e5883c3a53f65cf669d0ac1fc7d3354d35 (patch)
tree2cebeb823f9833370eb3e78db7e835f5cc093e6f /weed/topology/data_node_ec.go
parentaf67d99ca4aae35b3732654dda52aaa348a75fd9 (diff)
downloadseaweedfs-b58e25e5883c3a53f65cf669d0ac1fc7d3354d35.tar.xz
seaweedfs-b58e25e5883c3a53f65cf669d0ac1fc7d3354d35.zip
broadcast vid->location map to master clients for ec chards
Diffstat (limited to 'weed/topology/data_node_ec.go')
-rw-r--r--weed/topology/data_node_ec.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/weed/topology/data_node_ec.go b/weed/topology/data_node_ec.go
index 95635331b..2ea7fc6ad 100644
--- a/weed/topology/data_node_ec.go
+++ b/weed/topology/data_node_ec.go
@@ -92,3 +92,29 @@ func (dn *DataNode) DeleteEcShard(s *erasure_coding.EcVolumeInfo) {
}
}
+
+func (dn *DataNode) HasVolumesById(id needle.VolumeId) (hasVolumeId bool) {
+
+ // check whether normal volumes has this volume id
+ dn.RLock()
+ _, ok := dn.volumes[id]
+ if ok {
+ hasVolumeId = true
+ }
+ dn.RUnlock()
+
+ if hasVolumeId {
+ return
+ }
+
+ // check whether ec shards has this volume id
+ dn.ecShardsLock.RLock()
+ _, ok = dn.ecShards[id]
+ if ok {
+ hasVolumeId = true
+ }
+ dn.ecShardsLock.RUnlock()
+
+ return
+
+}