-
Notifications
You must be signed in to change notification settings - Fork 1.3k
CLOUDSTACK-9317: Enable/disable static NAT associates only relevant IPs. #1623
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
CLOUDSTACK-9317: Enable/disable static NAT associates only relevant IPs. #1623
Conversation
|
RPM packages built and available at: http://packages.shapeblue.com/cloudstack/custom/github-1623. |
|
|
||
| for (StaticNat snat : staticNats) { | ||
| userIps.add(_ipAddressDao.findById(snat.getSourceIpAddressId())); | ||
| } |
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.
Executing queries in a for loop in unnecessarily expensive. Could you please refactor this for loop into a new method on IPAddressDao that retrieves a list of IP addresses for a list of IPs?
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 makes sense, yes. Better to have one database query than many.
|
@ProjectMoon have you run the Also, is there a JIRA ticket associated with this change? |
|
JIRA ticket is CLOUDSTACK-9317. Have not run the Marvin tests, but will do so. |
|
@blueorangutan kick |
|
A Trillian-Jenkins job has been kicked to build packages and start testing. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian repo: http://packages.shapeblue.com/cloudstack/pr/1623 |
|
If possible, I would like to get this fix into 4.8.2.0/4.9.1.0, but I will be cutting the RC shortly. @ProjectMoon could you please amend your commit message to include the JIRA ticket ID and an explanation of the motivation for the change? @rhtyd @borisstoyanov can we push this PR through Trillian with smoke tests and the following test suites:
@murali-reddy Do you think we need to run any other test VR test cases for proper regression testing? |
|
Trillian test result (trillian-pr1623-38-vmware-55u3-cs48):
Trillian env - trillian-pr1623-38-vmware-55u3-cs48, Job ID 38 |
|
It's been amended and rebased. I still haven't had time to add a new DAO method to the IP address DAO. I can work on that now though. When is the RC being cut? |
|
@ProjectMoon I am trying to cut the 4.8.2.0 RC ASAP. This PR looks like it is not going to make it given the test failures. Do you mind re-pointing it to 4.9? We will make this PR a high priority for 4.9.2.0. |
|
Yeah. Unfortunately I have not had any time to work on the pull requests lately. When I have time I will reopen it against 4.9. |
|
@ProjectMoon I am extending the date for 4.8 to 25 Sept 2016. Therefore, if we can get the test failure fixed, we can get it into 4.8.2.0, 4.9.1.0, and 4.10.0.0. Also, could you please investigate the Travis and Jenkins build failures? |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-77 |
|
This one hasn't been rebased in quite a while, so the packages produced will be rather old. Going to rebase this against latest 4.8. |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-207 |
The previous behavior would send a list of all IPs with a state of add/revoke. This causes concurrency issues when multiple IPs were being added or removed, and could leave networks with wrong IP addresses assigned to the devices. By assigning and removing only the IP being changed per-request, the concurrency issue is removed and no real performance loss occurs.
|
Updated to latest 4.8. |
|
@ProjectMoon thanks |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-231 |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-420)
|
|
@abhinandanprateek @murali-reddy and others -- can we have review on this, thanks. |
|
Closed in favor of #1908 |
New version of #1450, opened against the 4.8 branch.
Original Description
This pull request fixes a concurrency issue when disabling static NAT on a bunch of IPs simultaneously. Under the old behavior, executing multiple disable requests would result in invalid IP associations being sent to the virtual router. This commit changes the behavior to apply an IP association for only the IP being added/released, which means that it is impossible for the virtual router to receive invalid data.
This was tested against a virtual router running on KVM and VMware. It would be nice to have some input how this change could affect redundant routers and other static NAT providers.