bhouse-nexthop commented on PR #14640: URL: https://github.com/apache/cloudstack/pull/14640#issuecomment-7138466122
@jmsperu thanks for the careful test, and for chasing the two bad runs down to the management server. I checked your analysis against the code and agree it is separate from this PR: - `NetworkOrchestrator.createNicForVm()` reads `_nicDao.getFreeDeviceId()` and only persists the NIC at the end of `allocateNic()`, with nothing held in between. Tiers implemented in parallel all plug a NIC into the same VPC router, so several of them can get the same device ID. - This PR only changes how the agent queues and applies aggregated commands for one router. It doesn't touch device ID assignment, so it can't cause or fix that. Two PlugNicCommands with the same `deviceId` leave the router with fewer interfaces than tiers, whatever the agent does with the aggregation queue. That fits the 2 gateways and the leftover `guest_network.json.<uuid>` files you saw. - That is also why my earlier 40/40 run had no missing gateways: the build I tested on also carried the device-ID fix. That device-ID race already has a PR: #14139 (against 4.22, root cause in #11710). Same approach as your #14815: it picks the free device ID and persists the NIC while holding a lock per instance (the `vm_instance` row lock, held in the same transaction as the NIC insert). It already has two code approvals (@DaanHoogland, @Damans227) but no independent test. If you could rerun your scenario with #14139 instead of #14815 (with this PR on the agents), that would give it the independent test. Then #14814 can be closed as a duplicate of #11710. I'm happy for the reviewers to pick either PR, as long as only one goes in. For this PR: your runs show the NPE gone (0 of 6, against 4 of 5 unpatched), and with the device-ID fix as well, 8 of 8 runs were clean. If you're OK with it, an approving review with that summary would count as its independent test. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
