Skip to content
This repository was archived by the owner on Mar 30, 2023. It is now read-only.

Commit dba614f

Browse files
committed
Add DAC_MAX_MDT_COUNT for more control in tests
1 parent b9c5b8e commit dba614f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

internal/pkg/pfsprovider/ansible/ansible.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"os/exec"
1212
"path"
1313
"path/filepath"
14+
"strconv"
1415
"strings"
1516
"time"
1617
)
@@ -35,14 +36,19 @@ type Wrapper struct {
3536
}
3637

3738
var DefaultHostGroup = "dac-prod"
38-
var MaxMDTs uint = 24
39+
var DefaultMaxMDTs uint = 24
3940

4041
func getInventory(fsType FSType, volume registry.Volume, brickAllocations []registry.BrickAllocation) string {
4142
// NOTE: only used by lustre
4243
mgsDevice := os.Getenv("DAC_MGS_DEV")
4344
if mgsDevice == "" {
4445
mgsDevice = "sdb"
4546
}
47+
maxMDTs := DefaultMaxMDTs
48+
maxMDTsConf, err := strconv.ParseUint(os.Getenv("DAC_MAX_MDT_COUNT"), 10, 32)
49+
if err == nil && maxMDTsConf > 0 {
50+
maxMDTs = uint(maxMDTsConf)
51+
}
4652

4753
allocationsByHost := make(map[string][]registry.BrickAllocation)
4854
for _, allocation := range brickAllocations {
@@ -55,7 +61,7 @@ func getInventory(fsType FSType, volume registry.Volume, brickAllocations []regi
5561
mdts := make(map[string]int)
5662
osts := make(map[string]int)
5763
for _, allocation := range allocations {
58-
if allocation.AllocatedIndex < MaxMDTs {
64+
if allocation.AllocatedIndex < maxMDTs {
5965
mdts[allocation.Device] = int(allocation.AllocatedIndex)
6066
}
6167
osts[allocation.Device] = int(allocation.AllocatedIndex)

0 commit comments

Comments
 (0)