gluster / glusterd2

[DEPRECATED] Glusterd2 is the distributed management framework to be used for GlusterFS.
GNU General Public License v2.0
167 stars 82 forks source link

Allow volume create if the bricks can be created in quorum number of nodes #1091

Open atinmu opened 6 years ago

atinmu commented 6 years ago

In GD1's world, if one out of three nodes cluster go down all volume creation requests fail. In containers world, this becomes a bottleneck especially with intelligent volume provisioning. GD2 should be able to provide a capability where in such situation volume creation goes through. Once the glusterd service comes back on the pod, there should be a auto way to replay all the pending bricks provisioning on that pod.

aravindavk commented 5 years ago

Draft design:

Instead of depending on Transaction to replay the steps when that node comes up, we can maintain a flag in Brick structure to differentiate provisioned vs unprovisioned brick.

Brick {
    RootDevice  string
    VgName      string
    LvName      string
    Path        string
    Host        string
    Provisioned bool
}

During initial plan, in the first iteration plan using the list of online peers. If quorum bricks are available then look for devices from the list of offline peers. If the bricks are selected from offline peers mark the provisioned flag as false. Transaction step will not try to create the brick if brick.Provisioned == false.

Brick Start needs to be enhanced to check the above flag to decide that brick needs to be provisioned or not.

During Brick Start(During Volume start or Glusterd2 start or Volume set):

if !brick.Provisioned {
    provisionBrick(brick)
    brick.Provisioned = true
    updateVolumeInfo()  // After the brick.Provisioned change
}
generateBrickVolfile()
startBrick()

Changes required:

Notes:

@atinmu @oshankkumar @kshlm @amarts @Madhu-1 Let me know your thoughts.