-
Notifications
You must be signed in to change notification settings - Fork 701
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
carp: disable preemption leads to split master/backup when link flaps #2780
Comments
@mimugmail it sounds like it works as designed, persistent maintenance mode forces the VIP to use it's highest advertised skew ( core/src/etc/inc/interfaces.inc Lines 1686 to 1688 in f8178e9
And preempt when selected (net.inet.carp.preempt ==> 0) allows interfaces to act independently:
|
But does this really makes sense that LAN on OPN1 is master while WAN is master on OPN2 |
yes, that's the effect of "net.inet.carp.preempt=0", normally you don't want them to act independently. The docs from openbsd (https://www.openbsd.org/faq/pf/carp.html) are a bit more clear on the subject:
Our help text could probably be improved, but it does what it's supposed to do if you ask me. |
Hm, the helptext completely differs from the FAQ. Let me do some testing with a switch between .. I was always promoting to enable this feature only on stanby devices, but after reading the FAQ this is nonsense. Quite hard to keep on focused when enabling a feature which disables something and default is disabled. I'll send a PR with a better helptext when finished. Thanks for your time! |
Thank you Michael, I just updated the thread with new info: |
When the link on an interface goes down, the linkdown script removes the IP configuration. @fichtner This can be solved when ticking "Prevent Interface Removal". You introduced this cause of ZeroTier if I remember correctly. ATM I'm unsure if we just need to update the documentation or if this is a higher impact introduced with the interface lock? @AdSchellevis @fichtner opinions? |
Line 58 in 04259b4
|
Indeed. I removed the interface lock and tested again. Now the config is still not removed. Like @andrewhotlab wrote in forums, changed some stuff in interface and then it was working. For the archives: When users have problems with carp and mixed master/backup states, check via ifconfig if carp config is still there. :) |
Ok, I did a factory reset via console (option 4) and set up the machines from scratch (interfaces, rules, HA). Initial ifconfig on machine 1:
It's master and everything fine. I shut down the switch port of em0:
Now it's master for em1 (WAN) but machine 2 is master for em0 (LAN) since the interface config was completely removed. I went back and opened LAN config in UI, did nothing, only click
It seems some command from above is not executed at install/wizard so carp config is not really persistant, because after this, the interface config for em0 (LAN) on machine 1 looks fine:
Any ideas @AdSchellevis @fichtner |
I think it always did remove the configuration from the interface, although I'm not 100% sure. |
Yes, loosing the carp configuration on a interface makes a huge difference, cause it demotes back. The backup machine instead is backup for the running interface, but it doesn't receive skews for LAN cause machine 1 removed it's config and goes master. This was the log when the interface config wasnt made "persistant":
Look at the reason why demote -240 -> vhid removed |
EDIT:
Not true, it's demotion value is just 0 and it sends higher skew .. but it makes no difference, it's reproduceable and it's fixed when you touch the interface config after installation again. |
@fichtner as requested by you yesterday, here's the diff of config.xml before and after just opening lan interface config and hitting apply:
|
@mimugmail can you try e720c57 ? I think you're right, we shouldn't remove carp addresses as they might confuse the preemption settings. |
Thanks, I'll test tomorrow, need to find the power supplies for my test machines :) |
no rush :) |
ATM I'm fighting with a second carp problem. 2 machines connected with crossover cable, 4 vlans over 1 interface. 3 work fine, on the 4th, both are master, I can see on vlan interface via tcpdump both units sending carps, so unit 2 doesn't receive them .. this carp thing drives me cray :) |
@AdSchellevis e720c57 works perfect! thanks 👍 |
(cherry picked from commit e720c57)
I'm seeing here a reproduceable problem with CARP.
OPN1 is setup to sync config to OPN2, dedicated link, better skew
OPN2 is not setup to sync, dedicated link, disable preemtion ticked to force it always backup when OPN1 is there.
When I do an update cycle I update OPN2, reboot, when fine, set OPN1 to enter persistant maintainence mode. OPN2 takes over IPs and then I can update OPN1. While rebooting, when OPN2 looses a link on e.g. LAN, it releases it's state ... when OPN1 comes back it starts carp and get's master for this IP. I think the problem here is that OPN2 had disable preemption enabled. But normally I'd guess OPN1 shouldn't get any IP since it should be in persistance mode.
I discovered this cause I wanted to test some HA stuff and connected LAN via crossover and not a switch, so the LAN is always flapping while reboot.
I can successfully reproduce multiple times.
Perhaps this is also the answer for strange failover scenarios you can read time to time in the forums.
The text was updated successfully, but these errors were encountered: