Hi, if I read the code correctly, the demotion counter would only _prevent_ preemptive failover if the preempting master was demoted. A demoted master would failover to a less demoted backup no matter what the advbase / advskew timing says.
The relevant code is following sys/netinet/ip_carp.c:665. Here's the diff: --- carp.html.orig Sun Nov 12 11:26:42 2017 +++ carp.html Sun Nov 12 11:33:05 2017 @@ -194,8 +194,12 @@ By default, all carp(4) interfaces are added to the <tt>carp</tt> group. Each group has a <tt>carpdemote</tt> counter affecting all carp(4) interfaces belonging to that group. - As described below, it can be useful to group certain interfaces together - for failover purposes. + This enables failing over the whole group of interfaces in the event that + one interface goes down. + If one physical CARP-enabled interface goes down, CARP will increase + the demotion counter, <tt>carpdemote</tt>, by 1 on interface groups that + the carp(4) interface is a member of, in effect causing all group + members to fail-over together. <dt><tt><i>ipaddress</i></tt> <dd>This is the shared IP address assigned to the redundancy group. @@ -219,12 +223,6 @@ <dt><tt>net.inet.carp.preempt</tt> <dd>Allow hosts within a redundancy group that have a better <tt>advbase</tt> and <tt>advskew</tt> to preempt the master. - In addition, this option also enables failing over a group of interfaces - together in the event that one interface goes down. - If one physical CARP-enabled interface goes down, CARP will increase - the demotion counter, <tt>carpdemote</tt>, by 1 on interface groups that - the carp(4) interface is a member of, in effect causing all group - members to fail-over together. <tt>net.inet.carp.preempt</tt> is 0 (disabled) by default. <dt><tt>net.inet.carp.log</tt> @@ -414,7 +412,7 @@ Configure fw1: <blockquote><pre> -! enable preemption and group interface failover +! enable preemption # <b>sysctl net.inet.carp.preempt=1</b> # <b>echo 'net.inet.carp.preempt=1' >> /etc/sysctl.conf</b> @@ -437,7 +435,7 @@ Configure fw2: <blockquote><pre> -! enable preemption and group interface failover +! enable preemption # <b>sysctl net.inet.carp.preempt=1</b> # <b>echo 'net.inet.carp.preempt=1' >> /etc/sysctl.conf</b> -- http://gmerlin.de OpenPGP: http://gmerlin.de/christopher.pub 2779 7F73 44FD 0736 B67A C410 69EC 7922 34B4 2566
pgpLk4KwkZ2vJ.pgp
Description: OpenPGP digital signature