Skip to content
This repository was archived by the owner on Mar 26, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions e2e/brickmux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ func TestBrickMux(t *testing.T) {
r.Nil(err)
r.NotNil(client)

// Turn on brick mux cluster option
optReq := api.ClusterOptionReq{
Options: map[string]string{"cluster.brick-multiplex": "on"},
Options: map[string]string{"cluster.brick-multiplex": "invalidValue"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so we don't have a test where we set brick multiplexing to off now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we don't have a test for this as of now but I will add it.

}
err = client.ClusterOptionSet(optReq)
r.Nil(err)
r.NotNil(err)

// Create a 1 x 3 volume
var brickPaths []string
Expand Down
15 changes: 4 additions & 11 deletions e2e/glustershd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func testSelfHeal(t *testing.T, tc *testCluster) {
//glustershd pid file path
pidpath := path.Join(tc.gds[0].Rundir, "glustershd.pid")

for i := 1; i <= 2; i++ {
for i := 1; i <= 4; i++ {
brickPath := testTempDir(t, "brick")
brickPaths = append(brickPaths, brickPath)
}
Expand All @@ -39,11 +39,12 @@ func testSelfHeal(t *testing.T, tc *testCluster) {
Name: volname,
Subvols: []api.SubvolReq{
{
ReplicaCount: 2,
ReplicaCount: 3,
Type: "replicate",
Bricks: []api.BrickReq{
{PeerID: tc.gds[0].PeerID(), Path: brickPaths[0]},
{PeerID: tc.gds[0].PeerID(), Path: brickPaths[1]},
{PeerID: tc.gds[1].PeerID(), Path: brickPaths[1]},
{PeerID: tc.gds[2].PeerID(), Path: brickPaths[2]},
},
},
},
Expand Down Expand Up @@ -72,14 +73,6 @@ func testSelfHeal(t *testing.T, tc *testCluster) {
getBricksStatus, err := client.BricksStatus(volname)
r.Nil(err, fmt.Sprintf("brick status operation failed: %s", err))
count := 0
for brick := range getBricksStatus {
if getBricksStatus[brick].Info.PeerID.String() == tc.gds[0].PeerID() {
count++
}
}

r.Equal(count, 2)

for brick := range getBricksStatus {
if getBricksStatus[brick].Info.PeerID.String() == tc.gds[0].PeerID() {
process, err := os.FindProcess(getBricksStatus[brick].Pid)
Expand Down
2 changes: 1 addition & 1 deletion e2e/volume_ops_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestVolume(t *testing.T) {

r := require.New(t)

tc, err := setupCluster(t, "./config/1.toml", "./config/2.toml")
tc, err := setupCluster(t, "./config/1.toml", "./config/2.toml", "./config/3.toml")
r.Nil(err)
defer teardownCluster(tc)

Expand Down
7 changes: 6 additions & 1 deletion glusterd2/brickmux/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,18 @@ func getMaxBricksPerProcess() (int, error) {

// validateOption validates brick mux options
func validateOption(option, value string) error {
if option == "cluster.brick-multiplex" {
_, err := options.StringToBoolean(value)
if err != nil {
return err
}
}
if option == "cluster.max-bricks-per-process" {
_, err := strconv.Atoi(value)
if err != nil {
return errors.ErrInvalidIntValue
}
}

return nil
}

Expand Down
2 changes: 1 addition & 1 deletion glusterd2/options/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var ClusterOptMap = map[string]*ClusterOption{
"cluster.shared-storage": {"cluster.shared-storage", "off", OptionTypeBool, nil},
"cluster.op-version": {"cluster.op-version", strconv.Itoa(gdctx.OpVersion), OptionTypeInt, nil},
"cluster.max-op-version": {"cluster.max-op-version", strconv.Itoa(gdctx.OpVersion), OptionTypeInt, nil},
"cluster.brick-multiplex": {"cluster.brick-multiplex", "off", OptionTypeBool, nil},
"cluster.brick-multiplex": {"cluster.brick-multiplex", "on", OptionTypeBool, nil},
"cluster.max-bricks-per-process": {"cluster.max-bricks-per-process", "250", OptionTypeInt, nil},
"cluster.localtime-logging": {"cluster.localtime-logging", "off", OptionTypeBool, nil},
}
Expand Down