-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Conversation
/release-note-none |
/assign @jsafrane |
There was a problem hiding this 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 patchSigned-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.
pkg/volume/glusterfs/glusterfs.go
Outdated
@@ -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>'. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
@obnoxxx It was there in the PR title, however forgot in the commit message. Addressed it latest patch set. PTAL. Thanks. |
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
/retest |
lgtm-ish, please squash the patches please. |
@jsafrane writes:
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm |
[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 |
/kind bug |
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