Force bonds/vlans re-parsing when lower layer changes#5902
Force bonds/vlans re-parsing when lower layer changes#5902eriknordmark merged 1 commit intolf-edge:masterfrom
Conversation
ff75f7b to
15aceeb
Compare
eriknordmark
left a comment
There was a problem hiding this comment.
Run tests. Some yetus issues to fix.
Those yetus issues shown are for unchanged lines. In fact, the Yetus check is green, so this is some github/yetus/workflow fail. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5902 +/- ##
==========================================
+ Coverage 21.62% 22.07% +0.44%
==========================================
Files 464 474 +10
Lines 83994 85692 +1698
==========================================
+ Hits 18166 18914 +748
- Misses 64300 65073 +773
- Partials 1528 1705 +177 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
If you look to the logs, Yetus is passing100%, I think is checking correctly only the patch. You see the other errors because they were propagated from the annotation step. The annotation step will not fail (on purpose), I based the final result exclusively from Yetus, but we can change that.... In any case, @milan-zededa , it makes sense to take this opportunity and fix these Yetus errors in the files you changed and make them truly 100% pass... |
parseBonds and parseVlans each use a content hash to skip parsing when their own config is unchanged. However, both store pointers to lower-layer objects (physio pointers in bond.lowerPhysPorts, bond pointers in vlan.lowerL2Ports) obtained at parse time. If a lower layer is parsed without the dependent layer being parsed, those pointers become stale (pointing at parsed old config). Fix by propagating force-parse down the dependency chain: - parseBonds is forced to parse when physio changes - parseVlans is forced to parse when physio or bonds change Signed-off-by: Milan Lenco <milan@zededa.com>
15aceeb to
f557b5d
Compare
|
Rebased on the top of the latest master. I do not really want to include unrelated changes to this PR just to please Yetus. |
Description
parseBondsandparseVlanseach use a content hash to skip parsing when their own config is unchanged. However, both store pointers to lower-layer objects (physio pointers inbond.lowerPhysPorts, bond pointers invlan.lowerL2Ports) obtained at parse time. If a lower layer is parsed without the dependent layer being parsed, those pointers become stale (pointing at parsed old config).Fix by propagating force-parse down the dependency chain:
parseBondsis forced to parse when physio changesparseVlansis forced to parse when physio or bonds changeHow to test and validate this PR
Set up a device with four network adapters (e.g.
eth0–eth3) and configure two bonds with VLAN sub-interfaces on top:Initial config
bond1: aggregateseth0,eth1— management uplink (DHCP)bond2: aggregateseth2,eth3vlan20,vlan21: parent portbond2Apply this config and confirm the device connects and reports no port errors.
Config change — swap
eth1andeth2between the bondsbond1: aggregateseth0,eth2bond2: aggregateseth1,eth3Expected (correct) result
/run/zedagent/DevicePortConfig/zedagent.jsonshould show:bond1.Bond.AggregatedPorts = ["eth0", "eth2"]bond2.Bond.AggregatedPorts = ["eth1", "eth3"]LastErroron any portRegression (what the bug produced)
Without the fix, parsed VLAN config would remain stale from a prior parse and
zedagent.jsoncould showeth2under bothbond1andbond2, resulting in:Changelog notes
Fixed a bug where re-configuring bond membership (e.g. swapping physical interfaces between two bonds) could leave the device with a broken network configuration and a
port aggregated by multiple bondserror, requiring a reboot to recover.PR Backports
Checklist