Skip to content

Commit

Permalink
ceph: initialize rbd block pool after creation
Browse files Browse the repository at this point in the history
This is done in order to prevent deadlock when parallel
PVC create requests are issued on a new uninitialized
rbd block pool due to https://tracker.ceph.com/issues/52537.

Fixes: rook#8696

Signed-off-by: Rakshith R <rar@redhat.com>
  • Loading branch information
Rakshith-R committed Oct 6, 2021
1 parent 00cef45 commit 31b62c4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/daemon/ceph/client/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,12 @@ func CreateECPoolForApp(context *clusterd.Context, clusterInfo *ClusterInfo, poo
return errors.Wrapf(err, "failed to create EC pool %s. %s", poolName, string(output))
}

args = []string{"pool", "init", poolName}
output, err = NewRBDCommand(context, clusterInfo, args).Run()
if err != nil {
return errors.Wrapf(err, "failed to initialize EC pool %s. %s", poolName, string(output))
}

if enableECOverwrite {
if err = SetPoolProperty(context, clusterInfo, poolName, "allow_ec_overwrites", "true"); err != nil {
return errors.Wrapf(err, "failed to allow EC overwrite for pool %s", poolName)
Expand Down Expand Up @@ -406,6 +412,12 @@ func CreateReplicatedPoolForApp(context *clusterd.Context, clusterInfo *ClusterI
return errors.Wrapf(err, "failed to create replicated pool %s. %s", poolName, string(output))
}

args = []string{"pool", "init", poolName}
output, err = NewRBDCommand(context, clusterInfo, args).Run()
if err != nil {
return errors.Wrapf(err, "failed to initialize replicated pool %s. %s", poolName, string(output))
}

if !clusterSpec.IsStretchCluster() {
// the pool is type replicated, set the size for the pool now that it's been created
if err := SetPoolReplicatedSizeProperty(context, clusterInfo, poolName, strconv.FormatUint(uint64(pool.Replicated.Size), 10)); err != nil {
Expand Down

0 comments on commit 31b62c4

Please sign in to comment.