fix: include VXLAN persistent networks in cleanup resource dispatch - #13968
Open
waterWang wants to merge 1 commit into
Open
fix: include VXLAN persistent networks in cleanup resource dispatch#13968waterWang wants to merge 1 commit into
waterWang wants to merge 1 commit into
Conversation
cleanupPersistentnNetworkResources() only sent CleanupPersistentNetworkResourceCommand for networks whose broadcast URI scheme is vlan, so vxlan:// persistent networks leaked bridges and VXLAN interfaces on hosts that never ran a VM on them. setupPersistentNetwork() creates resources for all persistent networks with no scheme filter, so the removal path must accept both Vlan and Vxlan schemes. Fixes apache#13966.
waterWang
force-pushed
the
fix/vxlan-persistent-network-cleanup
branch
from
August 25, 2026 11:10
1b605a6 to
3a0c98c
Compare
DaanHoogland
requested changes
Aug 26, 2026
DaanHoogland
left a comment
Contributor
There was a problem hiding this comment.
this needs to go on LTS branch 4.20 preferably or else 4.22 at least.
| } | ||
|
|
||
| private boolean networkMeetsPersistenceCriteria(NetworkVO network, NetworkOfferingVO offering, boolean cleanup) { | ||
| BroadcastDomainType broadcastDomainType = network.getBroadcastUri() != null ? BroadcastDomainType.getSchemeValue(network.getBroadcastUri()) : null; |
Contributor
There was a problem hiding this comment.
Suggested change
| BroadcastDomainType broadcastDomainType = network.getBroadcastUri() != null ? BroadcastDomainType.getSchemeValue(network.getBroadcastUri()) : null; | |
| BroadcastDomainType broadcastDomainType = BroadcastDomainType.getSchemeValue(network.getBroadcastUri()); |
nullcheck is part of the getSchemeValue() contract
Comment on lines
1607
to
+1608
| boolean criteriaMet = offering.isPersistent() && | ||
| (network.getBroadcastUri() != null && BroadcastDomainType.getSchemeValue(network.getBroadcastUri()) == BroadcastDomainType.Vlan); | ||
| (broadcastDomainType == BroadcastDomainType.Vlan || broadcastDomainType == BroadcastDomainType.Vxlan); |
Contributor
There was a problem hiding this comment.
it would be nice for readability to use a list of values:
Suggested change
| boolean criteriaMet = offering.isPersistent() && | |
| (network.getBroadcastUri() != null && BroadcastDomainType.getSchemeValue(network.getBroadcastUri()) == BroadcastDomainType.Vlan); | |
| (broadcastDomainType == BroadcastDomainType.Vlan || broadcastDomainType == BroadcastDomainType.Vxlan); | |
| List<BroadcastDomainType> broadcastTypes = Arrays.asList(BroadcastDomainType.Vlan, BroadcastDomainType.Vxlan) | |
| boolean criteriaMet = offering.isPersistent() && broadcastTypes.contains(broadcastDomainType); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #13966
cleanupPersistentnNetworkResources()only sentCleanupPersistentNetworkResourceCommandfor networks whose broadcast URI scheme wasvlan. Forvxlan://persistent networks the cleanup command was never dispatched, so bridges and VXLAN interfaces were left behind on every host that never ran a VM on the network.setupPersistentNetwork()inDefaultHostListenercreates resources for all persistent networks fromgetAllPersistentNetworksFromZone()with no isolation-method filter, so the removal path must accept bothVlanandVxlanschemes to stay symmetric.Changes
engine/orchestration/.../NetworkOrchestrator.java:networkMeetsPersistenceCriteria()now accepts bothBroadcastDomainType.VlanandBroadcastDomainType.Vxlanbroadcast URI schemes (extracted to a localbroadcastDomainTypevariable for null-safety and readability).Testing
Vlan("vlan", Integer.class),Vxlan("vxlan", Long.class)inNetworks.java).