From owner-freebsd-stable@freebsd.org Fri Aug 21 11:13:01 2015 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB8309BCA8D for ; Fri, 21 Aug 2015 11:13:01 +0000 (UTC) (envelope-from ml@my.gd) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com [209.85.215.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4703916EA for ; Fri, 21 Aug 2015 11:13:00 +0000 (UTC) (envelope-from ml@my.gd) Received: by lagz9 with SMTP id z9so39182275lag.3 for ; Fri, 21 Aug 2015 04:12:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=lN6IqyCtUiNA3MiX8aCrwnObkBFzzjDrzxK9R7Pt3m8=; b=DbWpzQEV92/1DYzSDp3swblskPdOh7CU1plPO4TXY8dS70654E4ZotP+HA0u3/t/ap Pwg71kvDnqeqMZBhnWXNANrCnuVK66oMuhAx074kS33k60oPOcsUnQK1Hw84Do8s/8JZ JX/yqwiA8wVoycjcvjy76TssGV4EK4pQi0VFq82FxjMWSHm5++wP3Zj1UBG4HvmANDyX LtAgAd5GB5daBJc+hD/45iuKik0nI60hIYbhxb/PyQ8dRJvoU/Io6vDF8Ve/uJhSzu10 C89kafiqjwNSfNCaEUhhTXlZHlCuBXc3X/kupvhwhoTueYsFuIEzjFWVLVTA7uPR9+sz NS7w== X-Gm-Message-State: ALoCoQls8on5YCzk8MHuX1UeFFRO8S6y5kngGP/sZciRhPtBcEdVKFWYqjquPX9ksKXKuWZKug1J MIME-Version: 1.0 X-Received: by 10.152.87.116 with SMTP id w20mr7341620laz.119.1440155573284; Fri, 21 Aug 2015 04:12:53 -0700 (PDT) Received: by 10.112.60.34 with HTTP; Fri, 21 Aug 2015 04:12:53 -0700 (PDT) In-Reply-To: <55D6CE0D.9030806@norma.perm.ru> References: <55D6CE0D.9030806@norma.perm.ru> Date: Fri, 21 Aug 2015 13:12:53 +0200 Message-ID: Subject: Re: [POSSIBLE BUG] 10-STABLE CARP erroneously becomes master on boot From: Damien Fleuriot To: "Eugene M. Zheganin" Cc: "freebsd-stable@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 11:13:01 -0000 On 21 August 2015 at 09:06, Eugene M. Zheganin wrote: > Hi. > > On 20.08.2015 14:51, Damien Fleuriot wrote: > > > > Hello list, > > > > > > > > We've managed to find the source of the bug, if it is indeed a bug. > > > > It all comes down to the order in which the IP addresses are assigned to > > the interface from /etc/rc.conf. > > > > > > When using the following syntax, the physical IP address is configured > > AFTER the CARPs on the interface, which results in the CARP > advertisements > > being sourced from the CARP IP, triggering the double MASTER situation : > > ipv4_addrs_int="1.2.3.4/24" > > ifconfig_int_alias0="1.2.3.6/32 vhid 1 pass test advskew 20" > > > > When using either of the following syntaxes, the physical IP address is > > configured BEFORE the CARPs, which results in the CARP advertisements > being > > sourced from the physical IP and restoring normal functionality : > > ifconfig_int="inet 1.2.3.4/24" > > ifconfig_int_alias0="1.2.3.6/32 vhid 1 pass test advskew 20" > > OR > > ifconfig_int_alias0="1.2.3.4/24" > > ifconfig_int_alias1="1.2.3.6/32 vhid 1 pass test advskew 20" > > > It has been there since carp-ng was commited to the 10-CURRENT 2 years > ago. The thing is, carp-ng doesn't need a non-carp address on an > interface anymore, both nodes can work fine using only shared address. > This isn't comfortable in lots of cases, but still. Thus, kernel sends > carp advertisements from a primary address on the interface (which is > normal behavior for any known network stack) and for FreeBSD that > primary address has always been the first address on an interface for a > given AF. Thus, your split-brain carp situation cause lies definitely > somewhere else. I'm running carp on FreeBSD for years, including legacy > one; if there is a bug - the situation you are describing probably isn't > one. > > Eugene, agree to disagree here. I've also been using CARP for years, both legacy and carp-ng, and while I'm not an expert on its inner workings I do understand how it operates. What you describe WRT the network stack and sourcing the advertisements is correct, I'll give you that. The problem lies not with CARP but with how the IP addresses are assigned by rc.conf It is abnormal that the CARP addresses should be set up first, when using the "ipv4_addrs_int" syntax. Therein lies the problem.