@@ -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
3738var DefaultHostGroup = "dac-prod"
38- var MaxMDTs uint = 24
39+ var DefaultMaxMDTs uint = 24
3940
4041func 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