Uh oh!
There was an error while loading. Please reload this page.
CLOUDSTACK-9317: Enable/disable static NAT associates only relevant IPs. - #1623
CLOUDSTACK-9317: Enable/disable static NAT associates only relevant IPs.#1623ProjectMoon wants to merge 1 commit into
Conversation
blueorangutan
commented
Aug 4, 2016
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.
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.
This makes sense, yes. Better to have one database query than many.
jburwell
commented
Aug 4, 2016
@ProjectMoon have you run the Also, is there a JIRA ticket associated with this change? |
ProjectMoon
commented
Aug 5, 2016
JIRA ticket is CLOUDSTACK-9317. Have not run the Marvin tests, but will do so. |
yadvr
commented
Aug 5, 2016
@blueorangutan kick |
blueorangutan
commented
Aug 5, 2016
A Trillian-Jenkins job has been kicked to build packages and start testing. I'll keep you posted as I make progress. |
blueorangutan
commented
Aug 5, 2016
Packaging result: ✔centos6 ✔centos7 ✔debian repo: http://packages.shapeblue.com/cloudstack/pr/1623 |
jburwell
commented
Aug 23, 2016
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? |
blueorangutan
commented
Aug 23, 2016
Trillian test result (trillian-pr1623-38-vmware-55u3-cs48):
Trillian env - trillian-pr1623-38-vmware-55u3-cs48, Job ID 38 |
ProjectMoon
commented
Aug 23, 2016
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? |
jburwell
commented
Aug 29, 2016
@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. |
ProjectMoon
commented
Aug 29, 2016
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. |
jburwell
commented
Sep 18, 2016
@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? |
yadvr
commented
Oct 21, 2016
@blueorangutan package |
blueorangutan
commented
Oct 21, 2016
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
blueorangutan
commented
Oct 21, 2016
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-77 |
ProjectMoon
commented
Oct 21, 2016
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. |
yadvr
commented
Nov 20, 2016
@blueorangutan package |
blueorangutan
commented
Nov 20, 2016
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
blueorangutan
commented
Nov 20, 2016
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.
ProjectMoon
commented
Nov 21, 2016
Updated to latest 4.8. |
yadvr
commented
Nov 23, 2016
@ProjectMoon thanks |
blueorangutan
commented
Nov 23, 2016
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
blueorangutan
commented
Nov 23, 2016
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-231 |
yadvr
commented
Nov 24, 2016
@blueorangutan test |
blueorangutan
commented
Nov 24, 2016
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
blueorangutan
commented
Nov 24, 2016
Trillian test result (tid-420)
|
yadvr
commented
Nov 25, 2016
@abhinandanprateek@murali-reddy and others -- can we have review on this, thanks. |
yadvr
commented
Nov 28, 2016
ProjectMoon
commented
Jan 17, 2017
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.