Skip to content
This repository has been archived by the owner on Mar 26, 2020. It is now read-only.

Commit

Permalink
Skip local bricks path validation if auto provisioned volume
Browse files Browse the repository at this point in the history
Brick paths are generated while creating smart volume using volume
name, subvol number and brick number. So collision will not happen
when multiple smart volumes are created.

Signed-off-by: Aravinda VK <avishwan@redhat.com>
  • Loading branch information
aravindavk authored and Atin Mukherjee committed Jan 16, 2019
1 parent 1353b0e commit 5800472
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
10 changes: 7 additions & 3 deletions glusterd2/commands/volumes/brick-replace-txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,13 @@ func replaceVolinfo(c transaction.TxnCtx) error {
return err
}

allBricks, err := volume.GetAllBricksInCluster()
if err != nil {
return err
var allBricks []brick.Brickinfo
// Validate brick paths only if it is not a smart volume
if newBrick.Size == 0 {
allBricks, err = volume.GetAllBricksInCluster()
if err != nil {
return err
}
}

// Used by other peers to check if proposed bricks are already in use.
Expand Down
10 changes: 7 additions & 3 deletions glusterd2/commands/volumes/volume-create-txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,13 @@ func createVolinfo(c transaction.TxnCtx) error {
return err
}

allBricks, err := volume.GetAllBricksInCluster()
if err != nil {
return err
var allBricks []brick.Brickinfo
// Validate brick paths only if it is not a smart volume
if req.Size == 0 {
allBricks, err = volume.GetAllBricksInCluster()
if err != nil {
return err
}
}

// Used by other peers to check if proposed bricks are already in use.
Expand Down
10 changes: 7 additions & 3 deletions glusterd2/commands/volumes/volume-expand-txn.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,13 @@ func expandValidatePrepare(c transaction.TxnCtx) error {
return err
}

allBricks, err := volume.GetAllBricksInCluster()
if err != nil {
return err
var allBricks []brick.Brickinfo
// Validate brick paths only if it is not a smart volume
if req.Size == 0 {
allBricks, err = volume.GetAllBricksInCluster()
if err != nil {
return err
}
}

// Used by other peers to check if proposed bricks are already in use.
Expand Down

0 comments on commit 5800472

Please sign in to comment.