Re: [PATCH 3/4] Elect higher IP addresses in case the priority is equal

"Ryan O'Hara" <[email protected]>
Newsgroups gmane.linux.keepalived.devel
Message-ID <[email protected]>
On Fri, May 16, 2014 at 05:30:43AM -0700, Catalin Gheorghe wrote:
> Sorry to intrude, but doesn't RFC3768 state differently:
> 
> RFC 3768:
> (1) A Backup router will not attempt to preempt the Master unless it has higher priority.  (2) Backup state description [...] -  If an ADVERTISEMENT is received, then: If the Priority in the ADVERTISEMENT is Zero, then: o  Set the Master_Down_Timer to Skew_Time else: If Preempt_Mode is False, or If the Priority in the ADVERTISEMENT is greater than or equal to the local Priority, then: o Reset the Master_Down_Timer to Master_Down_Interval else: o Discard the ADVERTISEMENT endif     endif [,,,]

I agree. The IP address should only be used as a tie-breaker only when
priorities are equal and nopreempt is off. At least that has always
been my interpretation of the RFC.

> Maybe a configurable option for this?

Honestly I don't see the point. The nopreempt option should be
sufficient for configuring this behavior.

Ryan

> Best regards,
> Catalin
> 
> 
> 
> On Sunday, May 11, 2014 6:48 PM, Eilon Greenstein <[email protected]> wrote:
>  
> 
> 
> From: Dharmender Garg <[email protected]>
> 
> This patch set the master according to the higher IP address in case the priority
> is the same.
> 
> Signed-off-by: Dharmender Garg <[email protected]>
> Signed-off-by: Eilon Greenstein <[email protected]>
> ---
> keepalived/vrrp/vrrp.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/keepalived/vrrp/vrrp.c b/keepalived/vrrp/vrrp.c
> index 8f4f702..a930009 100644
> --- a/keepalived/vrrp/vrrp.c
> +++ b/keepalived/vrrp/vrrp.c
> @@ -901,10 +901,12 @@ vrrp_state_backup(vrrp_t * vrrp, char *buf, int buflen)
>         notify_instance_exec(vrrp, VRRP_STATE_GOTO_MASTER);
>     } else if (hd->priority == 0) {
>         vrrp->ms_down_timer = VRRP_TIMER_SKEW(vrrp);
> -    } else if (vrrp->nopreempt || hd->priority >= vrrp->effective_priority ||
> +    } else if (vrrp->nopreempt || hd->priority > vrrp->effective_priority ||
>            timer_cmp(vrrp->preempt_time, timer_now()) > 0) {
>         vrrp->ms_down_timer = 3 * vrrp->adver_int + VRRP_TIMER_SKEW(vrrp);
> -    } else if (hd->priority < vrrp->effective_priority) {
> +    } else if ((hd->priority < vrrp->effective_priority) ||
> +           (hd->priority == vrrp->effective_priority &&
> +             ntohl(saddr) < ntohl(VRRP_PKT_SADDR(vrrp)))) {
>         log_message(LOG_INFO, "VRRP_Instance(%s) forcing a new MASTER election"
>                     , vrrp->iname);
>         vrrp->wantstate = VRRP_STATE_GOTO_MASTER;
> -- 
> 1.8.4.3
> 
> 
> ------------------------------------------------------------------------------
> Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
> • 3 signs your SCM is hindering your productivity
> • Requirements for releasing software faster
> • Expert tips and advice for migrating your SCM now
> http://p.sf.net/sfu/perforce
> _______________________________________________
> Keepalived-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/keepalived-devel

> ------------------------------------------------------------------------------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing platform available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs

> _______________________________________________
> Keepalived-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/keepalived-devel


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Keepalived-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/keepalived-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.