diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2020-04-01 16:48:58 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-01 16:48:58 -0700 |
| commit | c446438ca5360b8e479e77dd0da32a80bd5644d6 (patch) | |
| tree | 9f984e23068124d2e37f465728fe82426f50c9aa /weed/topology/topology.go | |
| parent | d61bb60450e8fabc5c5961874fe2e69afa0200ec (diff) | |
| parent | eae3f27c8021ef1903419de43c68d2dc62a09953 (diff) | |
| download | seaweedfs-c446438ca5360b8e479e77dd0da32a80bd5644d6.tar.xz seaweedfs-c446438ca5360b8e479e77dd0da32a80bd5644d6.zip | |
Merge pull request #1255 from levenlabs/ignore
Added treat_replication_as_minimums master toml option
Diffstat (limited to 'weed/topology/topology.go')
| -rw-r--r-- | weed/topology/topology.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/weed/topology/topology.go b/weed/topology/topology.go index fbf998707..c24cab9d6 100644 --- a/weed/topology/topology.go +++ b/weed/topology/topology.go @@ -27,7 +27,8 @@ type Topology struct { pulse int64 - volumeSizeLimit uint64 + volumeSizeLimit uint64 + replicationAsMin bool Sequence sequence.Sequencer @@ -38,7 +39,7 @@ type Topology struct { RaftServer raft.Server } -func NewTopology(id string, seq sequence.Sequencer, volumeSizeLimit uint64, pulse int) *Topology { +func NewTopology(id string, seq sequence.Sequencer, volumeSizeLimit uint64, pulse int, replicationAsMin bool) *Topology { t := &Topology{} t.id = NodeId(id) t.nodeType = "Topology" @@ -48,6 +49,7 @@ func NewTopology(id string, seq sequence.Sequencer, volumeSizeLimit uint64, puls t.ecShardMap = make(map[needle.VolumeId]*EcShardLocations) t.pulse = int64(pulse) t.volumeSizeLimit = volumeSizeLimit + t.replicationAsMin = replicationAsMin t.Sequence = seq @@ -138,7 +140,7 @@ func (t *Topology) PickForWrite(count uint64, option *VolumeGrowOption) (string, func (t *Topology) GetVolumeLayout(collectionName string, rp *super_block.ReplicaPlacement, ttl *needle.TTL) *VolumeLayout { return t.collectionMap.Get(collectionName, func() interface{} { - return NewCollection(collectionName, t.volumeSizeLimit) + return NewCollection(collectionName, t.volumeSizeLimit, t.replicationAsMin) }).(*Collection).GetOrCreateVolumeLayout(rp, ttl) } |
