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

AWS: Fix long-standing bug in stringSetToPointers #26331

Merged
merged 1 commit into from
May 26, 2016

Conversation

therc
Copy link
Member

@therc therc commented May 26, 2016

Instead of N pointers, we were returning N null pointers, followed by the real
thing. It's not clear why we didn't trip on this until now, maybe there is a
new server-side check for empty subnetID strings.

Also add better logging around this.

Please remove release-note tag, bump priority to P1 (or P0, since this can cause customer throttling if enough services need to be synced at the same time), and backport to 1.2/1.1. I don't think I can do any of those.

cc @justinsb

@k8s-github-robot k8s-github-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. release-note-label-needed labels May 26, 2016
@therc
Copy link
Member Author

therc commented May 26, 2016

Someone with an unpatched controller-manager could try looking at AttachLoadBalancerToSubnets logs in CloudTrail. stringSetToPointers() is only called in exactly two points, the addition or removal of subnets during reconciliation, so if you keep your network layout always the same, you might never come across this.

@justinsb justinsb added this to the v1.3 milestone May 26, 2016
@justinsb justinsb added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label May 26, 2016
@justinsb justinsb changed the title Fix long-standing bug in aws.stringSetToPointers AWS: Fix long-standing bug in stringSetToPointers May 26, 2016
@justinsb justinsb added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-label-needed labels May 26, 2016
@justinsb
Copy link
Member

Thanks for fixing @therc

@justinsb justinsb added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels May 26, 2016
@@ -90,7 +90,7 @@ func (s *AWSCloud) ensureLoadBalancer(namespacedName types.NamespacedName, loadB
request := &elb.AttachLoadBalancerToSubnetsInput{}
request.LoadBalancerName = aws.String(loadBalancerName)
request.Subnets = stringSetToPointers(additions)
glog.V(2).Info("Attaching load balancer to added subnets")
glog.V(2).Infof("Attaching load balancer for %v to added subnets %v", request.LoadBalancerName, request.Subnets)
Copy link
Member

Choose a reason for hiding this comment

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

I think the subnets output will be useless, because it is a []*string (right?). If so, can we just remove both logging statement changes. That should also make this easier to backport (if we just have the actual fix in aws_utils.go)

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, in my case I could see that there were six pointers instead of three and that the first three were null. But yeah, backporting is probably a bigger deal than more verbose logging in an obscure case.

Instead of N pointers, we were returning N null pointers, followed by the real
thing. It's not clear why we didn't trip on this until now, maybe there is a
new server-side check for empty subnetID strings.
@therc
Copy link
Member Author

therc commented May 26, 2016

Removed the logging, rebased and squashed.

@therc
Copy link
Member Author

therc commented May 26, 2016

To make the case for backporting: if the nodes from a whole AZ disappear after e.g. a power loss, this bug can make the outage even worse.

@therc
Copy link
Member Author

therc commented May 26, 2016

@k8s-bot test this issue: #26342

@justinsb justinsb added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 26, 2016
@k8s-bot
Copy link

k8s-bot commented May 26, 2016

GCE e2e build/test passed for commit ca8699e.

@alex-mohr alex-mohr merged commit 0c20ae7 into kubernetes:master May 26, 2016
@roberthbailey
Copy link
Contributor

@therc Please create a cherry pick pull if you want to backport this into the 1.2 branch.

@roberthbailey roberthbailey added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Jun 2, 2016
@roberthbailey roberthbailey modified the milestones: v1.2, v1.3 Jun 4, 2016
@roberthbailey
Copy link
Contributor

@therc - as announced on the kubernetes-dev google group yesterday, we plan to cut 1.2.5 next week. If you'd like this change in that release, please create a cherry pick PR against the 1.2 branch asap. Thanks.

@therc
Copy link
Member Author

therc commented Jun 18, 2016

@roberthbailey it took me almost an hour, but I think I tamed my git remotes and the cherry-pick script into doing what I needed: #27664

@roberthbailey
Copy link
Contributor

Sorry for the trouble making the cherry pick. Is your development environment configured as described in https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md?

roberthbailey referenced this pull request Jun 20, 2016
…31-upstream-release-1.2

Fix long-standing bug in aws.stringSetToPointers
@therc
Copy link
Member Author

therc commented Jun 20, 2016

Thanks a lot for the help with the cherry pick! I think the main issue is that I had the official repo as both the upstream and origin remotes (plus a couple of forks). The document doesn't say much about setting up remotes. Thanks again!

@roberthbailey
Copy link
Contributor

I merged #27664 so I'm going to remove the cherrypick candidate label.

shyamjvs referenced this pull request in shyamjvs/kubernetes Dec 1, 2016
…ck-of-#26331-upstream-release-1.2

Fix long-standing bug in aws.stringSetToPointers
shouhong referenced this pull request in shouhong/kubernetes Feb 14, 2017
…ck-of-#26331-upstream-release-1.2

Fix long-standing bug in aws.stringSetToPointers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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

7 participants