From owner-freebsd-net@FreeBSD.ORG Wed Aug 10 05:48:54 2011 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BFAC1065675 for ; Wed, 10 Aug 2011 05:48:54 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id F32908FC15 for ; Wed, 10 Aug 2011 05:48:53 +0000 (UTC) Received: by fxe4 with SMTP id 4so868312fxe.13 for ; Tue, 09 Aug 2011 22:48:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=gkh296zNw0lxvM8wkgJCTaTnCpfyG2EhN8smyNvJkMU=; b=Hs0drSXUnfMIQQ4fB0WlnSg71ta//O5NS+6H8qlNsuCU/pB7ONGb4JfEP3z/IJyTfI vnweKnVLkzrzzWJEE30mMKsOoKYonpGQqKDAXPAYi1OqObYrGK7QZ2Q7OXS1MU5+9pnY mG71YSsCq2HdvxvZvQqdkfdldFWV5AX6CAvqA= Received: by 10.223.55.79 with SMTP id t15mr10709788fag.23.1312955332787; Tue, 09 Aug 2011 22:48:52 -0700 (PDT) Received: from localhost ([94.27.39.186]) by mx.google.com with ESMTPS id o18sm483791fal.23.2011.08.09.22.48.50 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 09 Aug 2011 22:48:50 -0700 (PDT) From: Mikolaj Golub To: Ferdinand Goldmann Organization: TOA Ukraine References: Sender: Mikolaj Golub Date: Wed, 10 Aug 2011 08:48:48 +0300 In-Reply-To: (Ferdinand Goldmann's message of "Mon, 8 Aug 2011 16:54:10 +0200") Message-ID: <86mxfhyfy7.fsf@in138.ua3> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-net@freebsd.org Subject: Re: Problem using CARP + HAST ... X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 05:48:54 -0000 On Mon, 8 Aug 2011 16:54:10 +0200 Ferdinand Goldmann wrote: FG> Hi! FG> I am trying to create a common resource pool for a certain application using FG> CARP/HAST as described in [1]. However while testing my setup I ran into a FG> problem which I don't know how to fix or work around: FG> If I shut down only the carp interface on the master (ifconfig carp0 down), FG> the slave will take note of this, make his carp interface the master and FG> mount the HAST storage using a script called by devd. Everything fine so far. BUT: FG> If, however, I completely shut down the masters network connection (using "shut" on FG> the switchport), the carp interface on the slave will still switch to master. FG> But the script for making the HAST storage primary will just hang forever: FG> root 46841 0.0 0.6 3628 1524 ?? S 4:21PM 0:00.08 /bin/sh /opt/bin/carp-hast-switch master FG> root 47043 0.0 2.6 42228 6580 ?? S 4:22PM 0:00.03 hastd: hast0 (secondary) (hastd) FG> Seemingly, this is because the hastd daemons on master and slave are unable to FG> communicate. So the script waits forever for the secondary device to go away... : FG> # Wait for any "hastd secondary" processes to stop FG> for disk in ${resources}; do FG> while $( pgrep -lf "hastd: ${disk} \(secondary\)" > /dev/null 2>&1 ); do FG> sleep 1 FG> done What freebsd are you running on? I suppose it is release, because on STABLE this issue should be fixed -- the secondary terminates after timeout. FG> Im a bit puzzled. Is there a way for hastd to make himself the master in case of a timeout FG> or such? Because in normal operation, whenever the carp interface fails, the underlying FG> infrastructure will most likely be down as well. On release you can just modify the script not to wait forever for hastd secondary to stop -- it will be terminated when the role is switched to primary. But anyway my advise is to use STABLE :-). -- Mikolaj Golub