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

feat: Add rados namespace support to rbd plugin #1035

Merged
merged 3 commits into from
Aug 12, 2020
Merged

Conversation

mehdy
Copy link
Contributor

@mehdy mehdy commented May 11, 2020

Describe what this PR does

Make sure to operate within the namespace if any given when dealing
with rbd images and snapshots and volume and snapshot journals.

Add some basic e2e tests using a namespace.

Is there anything that requires special attention

Do you have any questions?
No.

Is the change backward compatible?
Yes.

Are there concerns around backward compatibility?
No.

Provide any external context for the change, if any.

Related issues

Mention any github issues relevant to this PR. Adding below line
will help to auto close the issue once the PR is merged.

Fixes: #798

Future concerns

List items that are not part of the PR and do not impact it's
functionality, but are work items that can be taken up subsequently.

@mehdy mehdy changed the title rbd: Add rados namespace support feat: Add rados namespace support to rbd plugin May 11, 2020
@nixpanic nixpanic added enhancement New feature or request component/rbd Issues related to RBD labels May 11, 2020
@mehdy mehdy force-pushed the master branch 3 times, most recently from d415b8a to 402b201 Compare May 13, 2020 08:00
@mehdy
Copy link
Contributor Author

mehdy commented May 13, 2020

I'm using SetNamespace method a lot in this PR and it was removed this commit :))
Should I use journal.namespace = ns or rewrite a new SetNamespace method again or would you revert this commit?
@Madhu-1

@Madhu-1
Copy link
Collaborator

Madhu-1 commented May 13, 2020

I'm using SetNamespace method a lot in this PR and it was removed this commit :))
Should I use journal.namespace = ns or rewrite a new SetNamespace method again or would you revert this commit?
@Madhu-1

having SetNamespace makes sense now as you need to call it multiple times. @phlogistonjohn any thoughts?

@phlogistonjohn
Copy link
Contributor

Mutating a global object frequently strikes me as a "code smell" that should be avoided in general. That's one of the reasons I removed it.

I quickly looked at your PR here and see a very common pattern, and since I'm also attempting to refactor how the journal code works, many call sites I've become familiar with over the last few days. In these cases you're calling SetNamespace right before a call to something like volJournal.CheckReservation.

Without digging deeper into your changes, I'd suggest altering the journal function arguments and adding namespace there rather than repeatedly mutating the state of the volJournal/etc.

FWIW, I'm also trying to break up the functionality such that the operational functions in voljournal.go rely more on local state via a new type rather than the global volJournal/snapJournal values. This means I too will be changing the arguments of the same functions. So this is just a heads up that we're likely to make merge conflicts with each other. I'm not trying to worry or discourage you... just making you aware of it. :-)

@mehdy
Copy link
Contributor Author

mehdy commented May 13, 2020

@phlogistonjohn I'll change the journal functions to receive namespace as an argument as you suggested. Thanks!

About the refactoring work you mentioned, wouldn't it be better if you do it after this PR? :D

@mehdy mehdy force-pushed the master branch 20 times, most recently from 71ba97a to bb1df07 Compare May 19, 2020 11:53
@mergify
Copy link
Contributor

mergify bot commented Aug 8, 2020

This pull request now has conflicts with the target branch. Could you please resolve conflicts and force push the corrected changes? 🙏

@mehdy mehdy force-pushed the master branch 3 times, most recently from cb526de to 8b81a62 Compare August 9, 2020 19:13
Make sure to operate within the namespace if any given
when dealing with rbd images and snapshots and their journals.

Signed-off-by: Mehdy Khoshnoody <[email protected]>
A minimal documentation on how to use a rados namespace with rbd.

Signed-off-by: Mehdy Khoshnoody <[email protected]>
These test cases are will be executed against a rados namespace.
- Create a PVC and bind it to an app.
- Resize block PVC and check device size.
- Create a PVC clone and bind it to an app.

Signed-off-by: Mehdy Khoshnoody <[email protected]>
@mehdy
Copy link
Contributor Author

mehdy commented Aug 10, 2020

@Madhu-1 Resolved the conflicts and ready to merged.

@@ -12,6 +12,12 @@ kind: ConfigMap
# each such cluster in use.
# To add more clusters or edit MON addresses in an existing configmap, use
# the `kubectl replace` command.
# The <rados-namespace> is optional and represents a radosNamespace in the pool.
# If any given all the of the rbd images, snapshots and other metadata
Copy link
Collaborator

Choose a reason for hiding this comment

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

to me, it feels like we need to reword this and below line @mehdy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! How about this?

"To use a specific rados namespace for your rbd images and snapshots, provide the name of the desired rados namespace".

If you have something else in mind, I'd be glad to use the help.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@mehdy it looks good to me ! 👍

@humblec
Copy link
Collaborator

humblec commented Aug 10, 2020

@mehdy have we opened an issue for this or is it already resolved ?

When running e2e tests there was an error with the raw-block-pod but testing it again without any of changes against a clean environment the issue still exists (maybe it's another issue).

@mehdy
Copy link
Contributor Author

mehdy commented Aug 10, 2020

@mehdy have we opened an issue for this or is it already resolved ?

When running e2e tests there was an error with the raw-block-pod but testing it again without any of changes against a clean environment the issue still exists (maybe it's another issue).

This was an issue with my dev environment.

@Madhu-1
Copy link
Collaborator

Madhu-1 commented Aug 10, 2020

@humblec do you have any final comments on this feature? Can we take this in for v3.1.0?
Any code changes required?

@humblec
Copy link
Collaborator

humblec commented Aug 11, 2020

@mehdy have we opened an issue for this or is it already resolved ?

When running e2e tests there was an error with the raw-block-pod but testing it again without any of changes against a clean environment the issue still exists (maybe it's another issue).

This was an issue with my dev environment.

@mehdy can you removing it from the PR description then?

@mehdy
Copy link
Contributor Author

mehdy commented Aug 11, 2020

@humblec Done 👍

@humblec
Copy link
Collaborator

humblec commented Aug 11, 2020

@humblec do you have any final comments on this feature? Can we take this in for v3.1.0?
Any code changes required?

@Madhu-1 as discussed, lets take this in for 3.1.0, especially this was deferred from 3.0.0 to avoid last minute hiccups with 3.0.0 release!

@humblec
Copy link
Collaborator

humblec commented Aug 11, 2020

@humblec Done +1

@mehdy Thanks !! If at ll possible, its also good to have a mention or documentation around this change. But it can be a followup PR or can be discarded too!

@Madhu-1
Copy link
Collaborator

Madhu-1 commented Aug 11, 2020

@humblec do you have any final comments on this feature? Can we take this in for v3.1.0?
Any code changes required?

@Madhu-1 as discussed, lets take this in for 3.1.0, especially this was deferred from 3.0.0 to avoid last minute hiccups with 3.0.0 release!
As we have minimal upgrade testing

@humblec I would suggest testing the backward compatibility before taking it in.

@mehdy
Copy link
Contributor Author

mehdy commented Aug 11, 2020

@humblec Done +1

@mehdy Thanks !! If at ll possible, its also good to have a mention or documentation around this change. But it can be a followup PR or can be discarded too!

@humblec You're welcome! Sure. I'll see what I can do and I'll open a new PR if I had something to add.

@humblec humblec mentioned this pull request Aug 11, 2020
9 tasks
@Madhu-1 Madhu-1 requested a review from nixpanic August 11, 2020 13:15
@humblec
Copy link
Collaborator

humblec commented Aug 12, 2020

Merging this manually as discussed in the Slack as the auto merge is blocked for long time.

@humblec humblec merged commit 2044873 into ceph:master Aug 12, 2020
Madhu-1 added a commit to Madhu-1/ceph-csi that referenced this pull request Aug 12, 2020
merging of ceph#1035
broken the cephcsi building. This commits fixes
the build issue.

Signed-off-by: Madhu Rajanna <[email protected]>
Madhu-1 added a commit that referenced this pull request Aug 12, 2020
merging of #1035
broken the cephcsi building. This commits fixes
the build issue.

Signed-off-by: Madhu Rajanna <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/rbd Issues related to RBD enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Ceph's namespaces (not kubernetes namespaces)
6 participants