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: Add exclusive-lock and journaling image features for RBD image #684

Closed
wants to merge 2 commits into from
Closed

rbd: Add exclusive-lock and journaling image features for RBD image #684

wants to merge 2 commits into from

Conversation

woohhan
Copy link

@woohhan woohhan commented Oct 15, 2019

Describe what this PR does

Add exclusive-lock and journaling image features for rbd image

Current rbd plugin only supports the layering feature
for rbd image. Add exclusive-lock and journaling image
features for the rbd plugin.

Is there anything that requires special attention

If we enable the journaling feature, krbd doesn't work for the mount. We need to force mapping by rbd-nbd.

Related issues

closes: #676

Future concerns

NONE

@woohhan
Copy link
Author

woohhan commented Oct 15, 2019

Hi, I'm glad to join ceph-csi. If I have wrong code or concept, please let me know. I will fix up immediately. Thanks!

Copy link
Collaborator

@Madhu-1 Madhu-1 left a comment

Choose a reason for hiding this comment

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

@techhanx Thanks for the PR 👍

I would like to see a few things in this PR

  • passing exlusive-lock and journaling from storageclass
  • E2E to cover this scenario
  • Testing with krbd and rbd-nbd

pkg/rbd/rbd_util.go Outdated Show resolved Hide resolved
@Madhu-1
Copy link
Collaborator

Madhu-1 commented Oct 15, 2019

@dillaman PTAL

@woohhan
Copy link
Author

woohhan commented Oct 15, 2019

@Madhu-1
Thanks for your reply. I will add E2E test to cover this.
but i didn't understand other two suggestion. could you please explain more?

  • passing exlusive-lock and journaling from storageclass
    I'm testing by creating storage class parameter with 'imageFeatures: layering,journaling,exclusive-lock' and check the image has these features. is there any other to do? (except e2e tests)

  • Testing with krbd and rbd-nbd
    If we enable image journaling option, we can't mount with krbd. because It is not supported that mounting the journaling volume in krbd. we need to use rbd-nbd.

@Madhu-1
Copy link
Collaborator

Madhu-1 commented Oct 15, 2019

@Madhu-1
Thanks for your reply. I will add E2E test to cover this.
but i didn't understand other two suggestion. could you please explain more?

  • passing exlusive-lock and journaling from storageclass

okay I missed adding more information we need to update documentation and storageclass examples for these features https://github.com/ceph/ceph-csi/blob/master/examples/rbd/storageclass.yaml#L24-L26 and https://github.com/ceph/ceph-csi/blob/master/docs/deploy-rbd.md

I'm testing by creating storage class parameter with 'imageFeatures: layering,journaling,exclusive-lock' and check the image has these features. is there any other to do? (except e2e tests)

  • Testing with krbd and rbd-nbd
    If we enable image journaling option, we can't mount with krbd. because It is not supported that mounting the journaling volume in krbd. we need to use rbd-nbd.

i that case we need to error out in the node stage request if the mounter is krbd

@woohhan woohhan changed the title Add rbd image features that exclusive-lock, journaling WIP: Add rbd image features that exclusive-lock, journaling Nov 30, 2019
@woohhan
Copy link
Author

woohhan commented Nov 30, 2019

@Madhu-1 I applied your suggestion:) Could you please check the commit? Thanks.

@woohhan woohhan requested a review from Madhu-1 November 30, 2019 13:54
@woohhan woohhan changed the title WIP: Add rbd image features that exclusive-lock, journaling Add rbd image features that exclusive-lock, journaling Dec 1, 2019
@dimm0
Copy link

dimm0 commented Jan 4, 2020

How about object-map feature? Any reason to not enable it?

@woohhan
Copy link
Author

woohhan commented Jan 4, 2020

@dimm0 Yes, there's no reason to not enable the object-map feature. But the pr stale for now, If pr is processed, I will add the feature. Thanks :)

@dimm0
Copy link

dimm0 commented Mar 3, 2020

Is this still pending in the new version?

@cr1cr1
Copy link

cr1cr1 commented Mar 23, 2020

@Madhu-1 did you get a chance to review this PR? Thank you.

Copy link
Collaborator

@Madhu-1 Madhu-1 left a comment

Choose a reason for hiding this comment

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

changes look good, can you please resolve merge conflicts

pkg/rbd/rbd_util.go Outdated Show resolved Hide resolved
@Madhu-1 Madhu-1 added this to the release-3.0.0 milestone Apr 13, 2020
@woohhan
Copy link
Author

woohhan commented Apr 14, 2020

@Madhu-1 I made some code changes to make it easy to add image features in the future. For example, if we want to add a fast-diff image feature, we need to specify it requires an object map feature. Could you please review the code again?

@woohhan woohhan requested a review from Madhu-1 April 14, 2020 06:37
@woohhan woohhan changed the title Add rbd image features that exclusive-lock, journaling Add exclusive-lock and journlaing image features for RBD image Apr 14, 2020
Copy link
Collaborator

@Madhu-1 Madhu-1 left a comment

Choose a reason for hiding this comment

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

changes looks good, Thanks for adding Unit testing. i will review it once again

pkg/rbd/rbd_util.go Outdated Show resolved Hide resolved
@nixpanic nixpanic added this to In progress in Use go-ceph for volume management operations via automation Apr 14, 2020
@woohhan
Copy link
Author

woohhan commented Apr 15, 2020

@Madhu-1 I am looking at how to change this PR and trying to change the ImageFeature field from string to librbd.FeatureSet in rbdVolume struct. Can this makes another impact? Why is there a JSON tag in the rbdVolume type? The implementation of FeatureSet is here: https://github.com/ceph/go-ceph/blob/master/rbd/features.go#L106

current rbdVolume

type rbdVolume struct {
	RbdImageName       string
// ...
	ImageFeatures      string `json:"imageFeatures"`
// ...
}

changed rbdVolume

type rbdVolume struct {
	RbdImageName       string
// ...
	ImageFeatures      librbd.FeatureSet
// ...
}

@Madhu-1
Copy link
Collaborator

Madhu-1 commented Apr 15, 2020

@Madhu-1 I am looking at how to change this PR and trying to change the ImageFeature field from string to librbd.FeatureSet in rbdVolume struct. Can this makes another impact? Why is there a JSON tag in the rbdVolume type? The implementation of FeatureSet is here: https://github.com/ceph/go-ceph/blob/master/rbd/features.go#L106

current rbdVolume

type rbdVolume struct {
	RbdImageName       string
// ...
	ImageFeatures      string `json:"imageFeatures"`
// ...
}

changed rbdVolume

type rbdVolume struct {
	RbdImageName       string
// ...
	ImageFeatures      librbd.FeatureSet
// ...
}

we have json tag to support backward compatibility for v1.0.0 volumes, removing/changing the fields may result in breakage

@woohhan woohhan changed the title Add exclusive-lock and journlaing image features for RBD image WIP: Add exclusive-lock and journlaing image features for RBD image Apr 15, 2020
@woohhan
Copy link
Author

woohhan commented Apr 15, 2020

we have json tag to support backward compatibility for v1.0.0 volumes, removing/changing the fields may result in breakage

Ok, I will proceed without changing the field. Thanks!

@woohhan woohhan changed the title WIP: Add exclusive-lock and journlaing image features for RBD image Add exclusive-lock and journlaing image features for RBD image Apr 15, 2020
@woohhan
Copy link
Author

woohhan commented Apr 15, 2020

@Madhu-1 I added a new commit, and it seems to work fine. Can you please review again?

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.

Looks pretty good to me. Just a few minor comments that can be addressed.

go.mod Outdated Show resolved Hide resolved
pkg/rbd/rbd_util_test.go Outdated Show resolved Hide resolved
woohhan added 2 commits May 11, 2020 19:27
This PR upgrade go-ceph version to v0.3.0

Signed-off-by: woohhan <woohyung_han@tmax.co.kr>
Current rbd plugin only supports the layering feature
for rbd image. Add exclusive-lock and journaling image
features for the rbd plugin.

Signed-off-by: woohhan <woohyung_han@tmax.co.kr>
@nixpanic
Copy link
Member

I think the CI failed because of this problem:

May 11 12:21:12.848: INFO: At 2020-05-11 12:11:12 +0000 UTC - event for csi-rbd-demo-pod: {attachdetach-controller } SuccessfulAttachVolume: AttachVolume.Attach succeeded for volume "pvc-806abbbd-9380-11ea-9312-42010a140134" 
May 11 12:21:12.848: INFO: At 2020-05-11 12:11:29 +0000 UTC - event for csi-rbd-demo-pod: {kubelet minikube} FailedMount: MountVolume.MountDevice failed for volume "pvc-806abbbd-9380-11ea-9312-42010a140134" : rpc error: code = Internal desc = rbd: map failed exit status 6, rbd output: rbd: sysfs write failed
RBD image feature set mismatch. You can disable features unsupported by the kernel with "rbd feature disable replicapool/csi-vol-80a56ad0-9380-11ea-9c69-0242ac110010 journaling".

In case the attacher/rbd-plugin needs to write to /sys/..., it may need additional configuration in the deployment spec.

(note that the Semantic Pull Request bot is not enforced, failing is accepted - and we don't understand yet why it fails)

@woohhan
Copy link
Author

woohhan commented May 13, 2020

I think the CI failed because of this problem:

May 11 12:21:12.848: INFO: At 2020-05-11 12:11:12 +0000 UTC - event for csi-rbd-demo-pod: {attachdetach-controller } SuccessfulAttachVolume: AttachVolume.Attach succeeded for volume "pvc-806abbbd-9380-11ea-9312-42010a140134" 
May 11 12:21:12.848: INFO: At 2020-05-11 12:11:29 +0000 UTC - event for csi-rbd-demo-pod: {kubelet minikube} FailedMount: MountVolume.MountDevice failed for volume "pvc-806abbbd-9380-11ea-9312-42010a140134" : rpc error: code = Internal desc = rbd: map failed exit status 6, rbd output: rbd: sysfs write failed
RBD image feature set mismatch. You can disable features unsupported by the kernel with "rbd feature disable replicapool/csi-vol-80a56ad0-9380-11ea-9c69-0242ac110010 journaling".

In case the attacher/rbd-plugin needs to write to /sys/..., it may need additional configuration in the deployment spec.

(note that the Semantic Pull Request bot is not enforced, failing is accepted - and we don't understand yet why it fails)

@nixpanic looks deploy mounts /sys here? But it's strange, I haven't changed the code. I think I need to build a test environment again and fix it...

}
if err = validateImageFeatures(rbdVol.ImageFeatures, rbdVol.Mounter); err != nil {
// for backward compatibility, just log and pass
klog.Errorf(err.Error())
Copy link
Collaborator

Choose a reason for hiding this comment

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

logging and passing is not a good idea.

for _, f := range arr {
sf, found := supportedFeatures[f]
if !found {
return errors.Errorf("invalid feature %s for volume csi-rbdplugin", f)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return errors.Errorf("invalid feature %s for volume csi-rbdplugin", f)
return errors.Errorf("invalid feature %s for %s", f,reqName)

please pass request name for more clarity

@Madhu-1
Copy link
Collaborator

Madhu-1 commented May 13, 2020

E0511 12:16:37.634418 2911 rbd_util.go:604] feature journaling requires rbd-nbd for mounter
I0511 12:16:37.634510 2911 rbd_util.go:606] ID: 72 Req-ID: 0001-0024-b7b15817-390a-4571-b21f-ca6e7f7a502b-0000000000000001-1758ca5c-9380-11ea-90d0-0242ac110011 setting rbd image features: layering,journaling,exclusive-lock, mounter: rbd
I0511 12:16:37.634532 2911 rbd_util.go:608] ID: 72 Req-ID: 0001-0024-b7b15817-390a-4571-b21f-ca6e7f7a502b-0000000000000001-1758ca5c-9380-11ea-90d0-0242ac110011 setting disableInUseChecks on rbd volume to: false
I0511 12:16:37.841479 2911 rbd_util.go:231] ID: 72 Req-ID: 0001-0024-b7b15817-390a-4571-b21f-ca6e7f7a502b-0000000000000001-1758ca5c-9380-11ea-90d0-0242ac110011 rbd: status csi-vol-1758ca5c-9380-11ea-90d0-0242ac110011 using mon rook-ceph-mon-a.rook-ceph.svc.cluster.local:6789, pool replicapool
W0511 12:16:37.881034 2911 rbd_util.go:253] ID: 72 Req-ID: 0001-0024-b7b15817-390a-4571-b21f-ca6e7f7a502b-0000000000000001-1758ca5c-9380-11ea-90d0-0242ac110011 rbd: no watchers on csi-vol-1758ca5c-9380-11ea-90d0-0242ac110011
I0511 12:16:37.881080 2911 rbd_attach.go:208] ID: 72 Req-ID: 0001-0024-b7b15817-390a-4571-b21f-ca6e7f7a502b-0000000000000001-1758ca5c-9380-11ea-90d0-0242ac110011 rbd: map mon rook-ceph-mon-a.rook-ceph.svc.cluster.local:6789
W0511 12:16:37.943905 2911 rbd_attach.go:231] ID: 72 Req-ID: 0001-0024-b7b15817-390a-4571-b21f-ca6e7f7a502b-0000000000000001-1758ca5c-9380-11ea-90d0-0242ac110011 rbd: map error exit status 6, rbd output: rbd: sysfs write failed
RBD image feature set mismatch. You can disable features unsupported by the kernel with "rbd feature disable replicapool/csi-vol-1758ca5c-9380-11ea-90d0-0242ac110011 journaling".
In some cases useful info is found in syslog - try "dmesg | tail".
rbd: map failed: (6) No such device or address
E0511 12:16:37.944081 2911 utils.go:163] ID: 72 Req-ID: 0001-0024-b7b15817-390a-4571-b21f-ca6e7f7a502b-0000000000000001-1758ca5c-9380-11ea-90d0-0242ac110011 GRPC error: rpc error: code = Internal desc = rbd: map failed exit status 6, rbd output: rbd: sysfs write failed
RBD image feature set mismatch. You can disable features unsupported by the kernel with "rbd feature disable replicapool/csi-vol-1758ca5c-9380-11ea-90d0-0242ac110011 journaling".
In some cases useful info is found in syslog - try "dmesg | tail".
rbd: map failed: (6) No such device or address

the issue here is its using rbd mounted for image features layering,journaling,exclusive-lock is it something supported?

@mergify
Copy link
Contributor

mergify bot commented May 21, 2020

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

@Madhu-1 Madhu-1 removed this from the release-3.0.0 milestone Jul 20, 2020
@Madhu-1
Copy link
Collaborator

Madhu-1 commented Jul 20, 2020

moved this out of release-v3.0.0 milestone

@dimm0
Copy link

dimm0 commented Jul 21, 2020

moved this out of release-v3.0.0 milestone

Why!?

@Madhu-1
Copy link
Collaborator

Madhu-1 commented Jul 21, 2020

moved this out of release-v3.0.0 milestone

Why!?

As this PR is stale for at least last 2 months moved it to next release -v3.1.0

@Madhu-1 Madhu-1 added this to the release-v3.1.0 milestone Jul 21, 2020
@Madhu-1
Copy link
Collaborator

Madhu-1 commented Aug 6, 2020

@woohhan do you have free time to work on this one? or shall I take it over and mention your name as a co-author?

@woohhan
Copy link
Author

woohhan commented Aug 6, 2020

@Madhu-1 Could you please take it over? unfortunately i have no time to proceed... thanks

@Madhu-1
Copy link
Collaborator

Madhu-1 commented Aug 6, 2020

@Madhu-1 Could you please take it over? unfortunately i have no time to proceed... thanks

@woohhan Thanks for the confirmation 👍

Madhu-1 pushed a commit to Madhu-1/ceph-csi that referenced this pull request Aug 6, 2020
Current rbd plugin only supports the layering feature
for rbd image. Add exclusive-lock and journaling image
features for the rbd.

Signed-off-by: woohhan <woohyung_han@tmax.co.kr>
Co-authored-by: Madhu Rajanna <madhupr007@gmail.com>

This will abandon the PR ceph#684
@Madhu-1
Copy link
Collaborator

Madhu-1 commented Aug 6, 2020

closing this one in favor of #1325

@Madhu-1 Madhu-1 closed this Aug 6, 2020
Use go-ceph for volume management operations automation moved this from In progress to Done Aug 6, 2020
Madhu-1 pushed a commit to Madhu-1/ceph-csi that referenced this pull request Aug 6, 2020
Current rbd plugin only supports the layering feature
for rbd image. Add exclusive-lock and journaling image
features for the rbd.

Signed-off-by: woohhan <woohyung_han@tmax.co.kr>
Co-authored-by: Madhu Rajanna <madhupr007@gmail.com>

This will abandon the PR ceph#684
Madhu-1 pushed a commit to Madhu-1/ceph-csi that referenced this pull request Aug 6, 2020
Current rbd plugin only supports the layering feature
for rbd image. Add exclusive-lock and journaling image
features for the rbd.

Signed-off-by: woohhan <woohyung_han@tmax.co.kr>
Co-authored-by: Madhu Rajanna <madhupr007@gmail.com>

This will abandon the PR ceph#684
Madhu-1 pushed a commit to Madhu-1/ceph-csi that referenced this pull request Aug 6, 2020
Current rbd plugin only supports the layering feature
for rbd image. Add exclusive-lock and journaling image
features for the rbd.

Signed-off-by: woohhan <woohyung_han@tmax.co.kr>
Co-authored-by: Madhu Rajanna <madhupr007@gmail.com>

This will abandon the PR ceph#684
Madhu-1 pushed a commit to Madhu-1/ceph-csi that referenced this pull request Aug 6, 2020
Current rbd plugin only supports the layering feature
for rbd image. Add exclusive-lock and journaling image
features for the rbd.

Signed-off-by: woohhan <woohyung_han@tmax.co.kr>
Co-authored-by: Madhu Rajanna <madhupr007@gmail.com>

This will abandon the PR ceph#684
Madhu-1 pushed a commit to Madhu-1/ceph-csi that referenced this pull request Aug 6, 2020
Current rbd plugin only supports the layering feature
for rbd image. Add exclusive-lock and journaling image
features for the rbd.

Signed-off-by: woohhan <woohyung_han@tmax.co.kr>
Co-authored-by: Madhu Rajanna <madhupr007@gmail.com>

This will abandon the PR ceph#684
Madhu-1 pushed a commit to Madhu-1/ceph-csi that referenced this pull request Aug 6, 2020
Current rbd plugin only supports the layering feature
for rbd image. Add exclusive-lock and journaling image
features for the rbd.

Signed-off-by: woohhan <woohyung_han@tmax.co.kr>
Co-authored-by: Madhu Rajanna <madhupr007@gmail.com>

This will abandon the PR ceph#684
Madhu-1 pushed a commit to Madhu-1/ceph-csi that referenced this pull request Aug 10, 2020
Current rbd plugin only supports the layering feature
for rbd image. Add exclusive-lock and journaling image
features for the rbd.

Signed-off-by: woohhan <woohyung_han@tmax.co.kr>
Co-authored-by: Madhu Rajanna <madhupr007@gmail.com>

This will abandon the PR ceph#684
ceph-csi-bot pushed a commit to Madhu-1/ceph-csi that referenced this pull request Aug 17, 2020
Current rbd plugin only supports the layering feature
for rbd image. Add exclusive-lock and journaling image
features for the rbd.

Signed-off-by: woohhan <woohyung_han@tmax.co.kr>
Co-authored-by: Madhu Rajanna <madhupr007@gmail.com>

This will abandon the PR ceph#684
Madhu-1 pushed a commit to Madhu-1/ceph-csi that referenced this pull request Sep 17, 2020
Current rbd plugin only supports the layering feature
for rbd image. Add exclusive-lock and journaling image
features for the rbd.

Signed-off-by: woohhan <woohyung_han@tmax.co.kr>
Co-authored-by: Madhu Rajanna <madhupr007@gmail.com>

This will abandon the PR ceph#684
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
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Manage RBD image mirroring via StorageClass parameter
7 participants