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

Use pvc uid instead of pvc name in glusterfs endpoint name. #70286

Merged
merged 2 commits into from
Oct 29, 2018

Conversation

humblec
Copy link
Contributor

@humblec humblec commented Oct 26, 2018

GlusterFS: At present, endpoints and services are created
for glusterfs pvcs are in form of glusterfs-dynamic-
however this could cause issue if user deletes a PVC and immediately
creates a new one with the same name, PV controller will try to delete
the old PV and its endpoint and at the same the controller will try to create new PV
and the same endpoint. Depending on which event reaches the
controller first, it may create new PV, check that endpoints exists,
then delete the old PVC and delete endpoints already used by the new PV.

This patch changes the endpoint/service name to below format:

glusterfs-dynamic-<PVC UUID>.

By the uniqueness of UUID, above mentioned issue will no longer be present.

Signed-off-by: Humble Chirammal hchiramm@redhat.com

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 26, 2018
@humblec
Copy link
Contributor Author

humblec commented Oct 26, 2018

/release-note-none

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Oct 26, 2018
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. sig/storage Categorizes an issue or PR as relevant to SIG Storage. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 26, 2018
@humblec
Copy link
Contributor Author

humblec commented Oct 26, 2018

/assign @jsafrane

@humblec
Copy link
Contributor Author

humblec commented Oct 26, 2018

@obnoxxx as discussed in pr #69419 .

Copy link
Contributor

@obnoxxx obnoxxx left a comment

Choose a reason for hiding this comment

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

Thanks Humble, the change looks mostly good, just small comments inline.

And the commit message needs improvement:
Generally a good commit message should be in a format of:

GlusterFS: short 1-line summary of what the patch does

optionally,
more lines explaining
the patch

Signed-off-by: ....

So important is: a blank line after initial line. And don't start with the explanation in the initial line but with what the patch does.

@@ -822,11 +822,11 @@ func (p *glusterfsVolumeProvisioner) CreateVolume(gid int) (r *v1.GlusterfsVolum
return nil, 0, "", fmt.Errorf("failed to get cluster nodes for volume %s: %v", volume, err)
}

// The 'endpointname' is created in form of 'glusterfs-dynamic-<claimname>'.
// The 'endpointname' is created in form of 'glusterfs-dynamic-<PVC UUID>'.
Copy link
Contributor

Choose a reason for hiding this comment

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

it's UID not UUID

// createEndpointService() checks for this 'endpoint' existence in PVC's namespace and
// If not found, it create an endpoint and service using the IPs we dynamically picked at time
// if not found, it create an endpoint and service using the IPs we dynamically picked at time
Copy link
Contributor

Choose a reason for hiding this comment

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

This is correct but actually not related to the topic of this patch.
So that comment fix might be a separate patch...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Put it as a seperate commit.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @humblec . I noticed there is another error in the line: it create --> it creates. Maybe we just skip this hunk from the PR and consider the separate PR #70306 for comment cleanup?

At present, endpoints and services are created
for glusterfs pvcs are in form of glusterfs-dynamic-<PVC name>
however this could cause issue if user deletes a PVC and immediately
creates a new one with the same name, PV controller will try to delete
the old PV and its endpoint and at the same the controller will try to create new PV
and the same endpoint. Depending on which event reaches the
controller first, it may create new PV, check that endpoints exists,
then delete the old PVC and delete endpoints already used by the new PV.

This patch changes the endpoint/service name to below format:

`glusterfs-dynamic-<PVC UUID>`.

By the uniqueness of UUID, above mentioned issue will no longer be present.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
@humblec humblec changed the title Use pvc uuid instead of pvc name in glusterfs endpoint name. Use pvc uid instead of pvc name in glusterfs endpoint name. Oct 26, 2018
@humblec
Copy link
Contributor Author

humblec commented Oct 26, 2018

So important is: a blank line after initial line. And don't start with the explanation in the initial line but with what the patch does.

@obnoxxx It was there in the PR title, however forgot in the commit message. Addressed it latest patch set. PTAL. Thanks.

@humblec
Copy link
Contributor Author

humblec commented Oct 26, 2018

/retest

Copy link
Contributor

@obnoxxx obnoxxx left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@humblec
Copy link
Contributor Author

humblec commented Oct 26, 2018

/retest

@jsafrane
Copy link
Member

lgtm-ish, please squash the patches please.

@obnoxxx
Copy link
Contributor

obnoxxx commented Oct 26, 2018

@jsafrane writes:

lgtm-ish, please squash the patches please.

Why is that? I explicitly asked @humblec to split the patches because the comment-fix is not part of the topic of the other patch. If you prefer to have that in a different PR then, I'd rather have a second PR than polluting commits with unrelated changes.

Copy link
Contributor

@obnoxxx obnoxxx left a comment

Choose a reason for hiding this comment

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

spotted one more typo in the comment, that you are fixing, and was remembered of my patches previously posted in #68343 to clean up the comments, now resurrected in #70306..

// createEndpointService() checks for this 'endpoint' existence in PVC's namespace and
// If not found, it create an endpoint and service using the IPs we dynamically picked at time
// if not found, it create an endpoint and service using the IPs we dynamically picked at time
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks @humblec . I noticed there is another error in the line: it create --> it creates. Maybe we just skip this hunk from the PR and consider the separate PR #70306 for comment cleanup?

@jsafrane
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 29, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: humblec, jsafrane

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@humblec
Copy link
Contributor Author

humblec commented Oct 29, 2018

/kind bug

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Oct 29, 2018
@k8s-ci-robot k8s-ci-robot merged commit eb1aa87 into kubernetes:master Oct 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants