Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pool: initialize only rbd application pools #10963

Merged
merged 1 commit into from Sep 13, 2022

Conversation

Rakshith-R
Copy link
Member

rbd pool init cmd initializes pool for rbd images. This commit makes modification to init only
rbd application pools, since it is not required
by other pools like ".nfs",".mgr" & "mgr_devicehealth".

Signed-off-by: Rakshith R rar@redhat.com

refer: #8923 (comment)

This maybe the reason cephnfs with multus is failing too.
@parth-gr ^

@idryomov can you please take a look too.

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the developer guide).
  • Skip Tests for Docs: If this is only a documentation change, add the label skip-ci on the PR.
  • Reviewed the developer guide on Submitting a Pull Request
  • Pending release notes updated with breaking and/or notable changes for the next minor release.
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.

Copy link

@idryomov idryomov left a comment

Choose a reason for hiding this comment

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

Ack from the RBD perspective

return errors.Wrapf(err, "failed to initialize pool %q. %s", p.Name, string(output))
if appName == poolApplicationNameRBD {
// initialize only rbd pools.
logger.Infof("initializing pool %q", p.Name)

Choose a reason for hiding this comment

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

Suggested change
logger.Infof("initializing pool %q", p.Name)
logger.Infof("initializing pool %q for RBD use", p.Name)

if err != nil {
return errors.Wrapf(err, "failed to initialize pool %q. %s", p.Name, string(output))
}
logger.Infof("successfully initialized pool %q", p.Name)

Choose a reason for hiding this comment

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

Suggested change
logger.Infof("successfully initialized pool %q", p.Name)
logger.Infof("successfully initialized pool %q for RBD use", p.Name)

if err != nil {
return errors.Wrapf(err, "failed to initialize pool %q. %s", p.Name, string(output))
if appName == poolApplicationNameRBD {
// initialize only rbd pools.

Choose a reason for hiding this comment

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

Suggested change
// initialize only rbd pools.

output, err := cephclient.NewRBDCommand(context, clusterInfo, args).Run()
if err != nil {
return errors.Wrapf(err, "failed to initialize pool %q. %s", p.Name, string(output))
if appName == poolApplicationNameRBD {
Copy link
Member

Choose a reason for hiding this comment

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

Why this function is even called if it only needs to be run for poolApplicationNameRBD

@idryomov
Copy link

This maybe the reason cephnfs with multus is failing too. @parth-gr ^

Whatever the failure is, I doubt that because rbd pool init is a no-op for pools with application set to something other than rbd.

@Rakshith-R Rakshith-R force-pushed the init-only-rbd-pool branch 2 times, most recently from bfdcf0a to 1115bba Compare September 13, 2022 09:43
@Rakshith-R
Copy link
Member Author

Ack from the RBD perspective

Thanks, made requested changes 👍

Comment on lines 388 to 394
logger.Infof("initializing pool %q", p.Name)
args := []string{"pool", "init", p.Name}
output, err := cephclient.NewRBDCommand(context, clusterInfo, args).Run()
if err != nil {
return errors.Wrapf(err, "failed to initialize pool %q. %s", p.Name, string(output))
if appName == poolApplicationNameRBD {
logger.Infof("initializing pool %q for RBD use", p.Name)
args := []string{"pool", "init", p.Name}
output, err := cephclient.NewRBDCommand(context, clusterInfo, args).Run()
if err != nil {
return errors.Wrapf(err, "failed to initialize pool %q for RBD use. %s", p.Name, string(output))
}
logger.Infof("successfully initialized pool %q for RBD use", p.Name)
}
logger.Infof("successfully initialized pool %q", p.Name)
Copy link
Member

@Madhu-1 Madhu-1 Sep 13, 2022

Choose a reason for hiding this comment

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

Suggested change
logger.Infof("initializing pool %q", p.Name)
args := []string{"pool", "init", p.Name}
output, err := cephclient.NewRBDCommand(context, clusterInfo, args).Run()
if err != nil {
return errors.Wrapf(err, "failed to initialize pool %q. %s", p.Name, string(output))
if appName == poolApplicationNameRBD {
logger.Infof("initializing pool %q for RBD use", p.Name)
args := []string{"pool", "init", p.Name}
output, err := cephclient.NewRBDCommand(context, clusterInfo, args).Run()
if err != nil {
return errors.Wrapf(err, "failed to initialize pool %q for RBD use. %s", p.Name, string(output))
}
logger.Infof("successfully initialized pool %q for RBD use", p.Name)
}
logger.Infof("successfully initialized pool %q", p.Name)
if appName != poolApplicationNameRBD{
return nil
}
// create the pool
logger.Infof("creating pool %q in namespace %q", p.Name, clusterInfo.Namespace)
if err := cephclient.CreatePool(context, clusterInfo, clusterSpec, *p, appName); err != nil {
return errors.Wrapf(err, "failed to create pool %q", p.Name)
}
logger.Infof("initializing pool %q", p.Name)
args := []string{"pool", "init", p.Name}
output, err := cephclient.NewRBDCommand(context, clusterInfo, args).Run()
if err != nil {
return errors.Wrapf(err, "failed to initialize pool %q. %s", p.Name, string(output))
}
logger.Infof("successfully initialized pool %q", p.Name)
return nil

`rbd pool init` cmd initializes pool for rbd images.
This commit makes modification to init only
rbd application pools, since it is not required
by other pools like ".nfs",".mgr" & "mgr_devicehealth".

Signed-off-by: Rakshith R <rar@redhat.com>
@travisn
Copy link
Member

travisn commented Sep 13, 2022

rbd pool init is a no-op for pools with application set to something other than rbd.

Just to be clear, no behavior change is expected with this PR, except that the operator avoids a no-op call for non-rbd pools, right?

@Rakshith-R
Copy link
Member Author

rbd pool init is a no-op for pools with application set to something other than rbd.

Just to be clear, no behavior change is expected with this PR, except that the operator avoids a no-op call for non-rbd pools, right?

Yes,

@travisn travisn merged commit c057c41 into rook:master Sep 13, 2022
travisn added a commit that referenced this pull request Sep 13, 2022
pool: initialize only rbd application pools (backport #10963)
Comment on lines +388 to +390
if appName != poolApplicationNameRBD {
return nil
}
Copy link
Member

Choose a reason for hiding this comment

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

Is this the right behavior? Should we instead return a request to requeue the reconcile in 5-15 seconds or something instead so we are sure to configure the pool once it is initialized? @travisn ?

Copy link
Member

Choose a reason for hiding this comment

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

For non-rbd pools, the pool configuration is done at this point. For these pools there is no need to run rbd pool init, so we can just return.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants