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

rbd: consider rbd as default mounter if not set. #3080

Merged
merged 1 commit into from
May 9, 2022

Conversation

Madhu-1
Copy link
Collaborator

@Madhu-1 Madhu-1 commented May 4, 2022

For the default mounter the mounter option will not be set in the storageclass and as it is not available in the storageclass same will not be set in the volume context, Because of this, the mapOptions are getting discarded. If the mounter is not set assuming it's an rbd mounter.

Note:- If the mounter is not set in the storageclass we can set it in the volume context explicitly, Doing this check-in node server to support backward existing volumes and the check is minimal we are not altering the volume context.

fixes: #3076

Signed-off-by: Madhu Rajanna madhupr007@gmail.com

@mergify mergify bot added the component/rbd Issues related to RBD label May 4, 2022
@Madhu-1 Madhu-1 requested review from pkalever and a team May 4, 2022 09:04
@pkalever
Copy link

pkalever commented May 4, 2022

@Madhu-1
It will be good to have a test case for validating mount options from various mounters. Is this something that can be addressed in this PR?

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented May 4, 2022

@Madhu-1 It will be good to have a test case for validating mount options from various mounters. Is this something that can be addressed in this PR?

@pkalever i tried to check the map options like "mapOptions": "lock_on_read,queue_depth=1024" which we have in e2e. this does not show up in the mount |grep rbd output. do you have any other way to extract the mount options of the rbd device?

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented May 4, 2022

@idryomov might help here. @idryomov is there a way to check the map options of the already mapped rbd device?

@pkalever
Copy link

pkalever commented May 4, 2022

@pkalever i tried to check the map options like "mapOptions": "lock_on_read,queue_depth=1024" which we have in e2e. this does not show up in the mount |grep rbd output. do you have any other way to extract the mount options of the rbd device?

These are map time options and not mount options IMO. For userspace mounters check if the process cmd has the options tied and for krbd some /sys/blah/blah should have them (just grep lock_on_read in the /sys dir).

Thanks!

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented May 4, 2022

@pkalever i tried to check the map options like "mapOptions": "lock_on_read,queue_depth=1024" which we have in e2e. this does not show up in the mount |grep rbd output. do you have any other way to extract the mount options of the rbd device?

These are map time options and not mount options IMO.

👍

For userspace mounters check if the process cmd has the options tied and for krbd, some /sys/blah/blah should have them (just grep lock_on_read in the /sys dir).

Yes for nbd we can do that but let's wait for @idryomov reply to see if we can have a common approach to identity it.

Thanks!

@@ -252,7 +256,7 @@ func populateRbdVol(
// fallback to rbd-nbd,
rv.Mounter = rbdNbdMounter
} else {
rv.Mounter = req.GetVolumeContext()["mounter"]
rv.Mounter = mounter
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't rv.Mounter be already set here regardless because of

	if rbdVol.Mounter, ok = volOptions["mounter"]; !ok {
		rbdVol.Mounter = rbdDefaultMounter
	}

in genVolFromVolumeOptions?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, correct, this is doing the same thing. removed it now.

@@ -241,7 +241,11 @@ func populateRbdVol(
return nil, status.Error(codes.Internal, err.Error())
}

if req.GetVolumeContext()["mounter"] == rbdDefaultMounter &&
Copy link
Contributor

Choose a reason for hiding this comment

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

I might be misreading, but I think you could just switch to querying rv.Mounter instead of req.GetVolumeContext()["mounter"] here and get rid of the else branch entirely.

@idryomov
Copy link
Contributor

idryomov commented May 4, 2022

@idryomov might help here. @idryomov is there a way to check the map options of the already mapped rbd device?

There is -- config_info file /sys/bus/rbd/device/<id> directory (where <id> corresponds to /dev/rbd<id>) but I don't see any need to do that here, neither for krbd nor for rbd-nbd.

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented May 4, 2022

@idryomov changes are done PTAL.

@pkalever
Copy link

pkalever commented May 4, 2022

@Madhu-1 are you still considering adding e2e for MapOptions as part of this PR?

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented May 4, 2022

@Madhu-1 are you still considering adding e2e for MapOptions as part of this PR?

As it needs to be added in multiple places, will send a follow-up PR.

Copy link

@pkalever pkalever left a comment

Choose a reason for hiding this comment

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

If you want to delay the e2e test case addition PR, please consider raising an issue for now.
Rest all looks good to me!

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented May 9, 2022

@Mergifyio rebase

For the default mounter the mounter option
will not be set in the storageclass and as it is
not available in the storageclass same will not
be set in the volume context, Because of this the
mapOptions are getting discarded. If the mounter
is not set assuming it's an rbd mounter.

Note:- If the mounter is not set in the storageclass
we can set it in the volume context explicitly,
Doing this check-in node server to support backward
existing volumes and the check is minimal we are not
altering the volume context.

fixes: ceph#3076

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
@mergify
Copy link
Contributor

mergify bot commented May 9, 2022

rebase

✅ Branch has been successfully rebased

@humblec
Copy link
Collaborator

humblec commented May 9, 2022

hmm.. ideally if mounter has not been set in the SC, discarding the mapOptions is also valid I think..That could avoid some accidental mapOption setting via SC if its not meant for default mounter.. No strong opinion on we should stick to that model though.

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented May 9, 2022

hmm.. ideally if mounter has not been set in the SC, discarding the mapOptions is also valid I think..That could avoid some accidental mapOption setting via SC if its not meant for default mounter..

This is a bug fix that got introduced recently. if the mounter is not set in the SC, default is chosen as the rbd if they are till now we are applying the mapOptions. i don't really understand the concern here.

@humblec
Copy link
Collaborator

humblec commented May 9, 2022

hmm.. ideally if mounter has not been set in the SC, discarding the mapOptions is also valid I think..That could avoid some accidental mapOption setting via SC if its not meant for default mounter..

This is a bug fix that got introduced recently. if the mounter is not set in the SC, default is chosen as the rbd if they are till now we are applying the mapOptions. i don't really understand the concern here.

One thing which we have to be careful here is the scenario of mounter has not been set but tryothermounters set to true. In that case, the mapOptions could be gone to other mounters if krbd is not present and fail ?

@Madhu-1
Copy link
Collaborator Author

Madhu-1 commented May 9, 2022

hmm.. ideally if mounter has not been set in the SC, discarding the mapOptions is also valid I think..That could avoid some accidental mapOption setting via SC if its not meant for default mounter..

This is a bug fix that got introduced recently. if the mounter is not set in the SC, default is chosen as the rbd if they are till now we are applying the mapOptions. i don't really understand the concern here.

One thing which we have to be careful here is the scenario of mounter has not been set but tryothermounters set to true. In that case, the mapOptions could be gone to other mounters if krbd is not present and fail ?

what is the problem with that? why nbd will use krbd map options? mapOptions contains both krbd and nbd specific mapOptions. based on the mounter the specific mount options will be chosen.

Copy link
Member

@nixpanic nixpanic left a comment

Choose a reason for hiding this comment

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

The change looks good to me. The commit message is a little confusing, but I guess the small diff explains itself well enough too.

@Madhu-1 Madhu-1 added the ci/retry/e2e Label to retry e2e retesting on approved PR's label May 9, 2022
@ceph-csi-bot
Copy link
Collaborator

/retest ci/centos/mini-e2e-helm/k8s-1.21

@ceph-csi-bot
Copy link
Collaborator

@Madhu-1 "ci/centos/mini-e2e-helm/k8s-1.21" test failed. Logs are available at location for debugging

@ceph-csi-bot
Copy link
Collaborator

@Mergifyio requeue

@mergify
Copy link
Contributor

mergify bot commented May 9, 2022

requeue

❌ This pull request head commit has not been previously disembarked from queue.

@ceph-csi-bot
Copy link
Collaborator

/retest ci/centos/mini-e2e-helm/k8s-1.21

@ceph-csi-bot
Copy link
Collaborator

@Madhu-1 "ci/centos/mini-e2e-helm/k8s-1.21" test failed. Logs are available at location for debugging

@ceph-csi-bot
Copy link
Collaborator

@Mergifyio requeue

@mergify
Copy link
Contributor

mergify bot commented May 9, 2022

requeue

❌ This pull request head commit has not been previously disembarked from queue.

@ceph-csi-bot
Copy link
Collaborator

/retest ci/centos/mini-e2e-helm/k8s-1.21

@ceph-csi-bot
Copy link
Collaborator

@Madhu-1 "ci/centos/mini-e2e-helm/k8s-1.21" test failed. Logs are available at location for debugging

@ceph-csi-bot
Copy link
Collaborator

@Mergifyio requeue

@mergify
Copy link
Contributor

mergify bot commented May 9, 2022

requeue

❌ This pull request head commit has not been previously disembarked from queue.

@ceph-csi-bot
Copy link
Collaborator

/retest ci/centos/mini-e2e-helm/k8s-1.21

@ceph-csi-bot
Copy link
Collaborator

@Madhu-1 "ci/centos/mini-e2e-helm/k8s-1.21" test failed. Logs are available at location for debugging

@ceph-csi-bot
Copy link
Collaborator

@Mergifyio requeue

@mergify
Copy link
Contributor

mergify bot commented May 9, 2022

requeue

❌ This pull request head commit has not been previously disembarked from queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/retry/e2e Label to retry e2e retesting on approved PR's component/rbd Issues related to RBD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

csi-rbdplugin not picking up mapOptions properly
7 participants