From owner-freebsd-fs@FreeBSD.ORG Fri Mar 18 20:59:52 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02AD5106566B for ; Fri, 18 Mar 2011 20:59:52 +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 8624E8FC18 for ; Fri, 18 Mar 2011 20:59:51 +0000 (UTC) Received: by fxm11 with SMTP id 11so4743733fxm.13 for ; Fri, 18 Mar 2011 13:59:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:x-comment-to:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=RXV4nQQwnJiVEhwgmmisZBgrDjjnSSq1DRD4vdoPDY8=; b=g16ZT2TRxEtYwGvfGcC9b8PfC4ZjFKJEE+gKVbpRR6Ug7mi6cj6OBiQ4hg+wnzh/H/ xeZPzZE3CdfvgrT9ZApk06d24f8moAHI8fXg1knmvDd1653qW5aQDvM9T2Jm+0DclQLL nlh0Wa5pq53FtTnOMAf8bx+Q0JdlqJJchqoLI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=ckktDSTOPLhNEcJFxAXa5ezKEXdSP5bPhEV98xTQb5nK8A0b/aKwT1d+xxkckMH36L I+xWh4rE6eq8tiw6QnEJ4yr8tC12qd/cUrdkO4CXeeEX+epaGtOYlj2pAxxCPdIaxBkM 2SFLe0fu+Na/vVJHq6L+/7YdPyoaHQMcNnZ7k= Received: by 10.223.16.138 with SMTP id o10mr1820651faa.88.1300481990338; Fri, 18 Mar 2011 13:59:50 -0700 (PDT) Received: from localhost ([95.69.172.154]) by mx.google.com with ESMTPS id c11sm1542173fav.26.2011.03.18.13.59.48 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Mar 2011 13:59:48 -0700 (PDT) From: Mikolaj Golub To: Freddie Cash References: X-Comment-To: Freddie Cash Date: Fri, 18 Mar 2011 22:59:47 +0200 In-Reply-To: (Freddie Cash's message of "Thu, 17 Mar 2011 13:42:09 -0700") Message-ID: <8662rgrvp8.fsf@kopusha.home.net> 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-fs@freebsd.org Subject: Re: HAST + ZFS causes system to shutdown uncleanly? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2011 20:59:52 -0000 On Thu, 17 Mar 2011 13:42:09 -0700 Freddie Cash wrote: FC> On Thu, Mar 17, 2011 at 1:36 PM, Freddie Cash wrote: >> On Thu, Mar 17, 2011 at 12:32 PM, Thomas Johnson wrote: >>> Has anyone else noticed issues halting a system that is configured with a >>> ZFS filesystem on a HAST device? I am using HAST to replicate a ZFS >>> filesystem between two ESXi virtual machines (trying to emulate our >>> production systems in a test environment) and I've noticed that the system >>> doesn't seem to shutdown completely in this arrangement (hangs after "" >>> message). I did some poking around and learned that if I unmount my zfs >>> filesystems before shutdown, the shutdown finishes cleanly. Muddling my way >>> through the rc scripts, it looks like hastd is killed fairly early on in the >>> shutdown sequence. Presumably this is preventing the system from >>> syncing/unmounting the ZFS mounts, causing the shutdown to hang. >>> >>> Does this seem plausible? If so, any ideas on fix, besides making sure I >>> 'zfs unmount -a' before shutdown? >> >> Does it work if you manually add "hastd" to the REQUIRE: line in /etc/rc.d/zfs? >> >> Of course, that only works if you are starting zfs automatically via >> /etc/rc.conf, and not letting CARP/devd or something else manage the >> pool import process. FC> Thinking about it, perhaps we need a hook into the top of the FC> hastd_stop_precmd() function in /etc/rc.d/hastd? FC> Something like "hastd_stop_args" in /etc/rc.conf where we can put FC> commands to be run before hastd is stopped? FC> Then it would be as simple as putting hastd_stop_args="zfs unmount -a" FC> into /etc/rc.conf. FC> Or something along those lines, so that we stop any consumers of the FC> /dev/hast/* devices before we stop the hast daemon. IMHO, it is not HAST job to bother with such things. We always have something (heartbeat, carp, hastmon) to manage HAST (change role, mount fs, start applications). This something has it own rc scripts, on startup it sets roles and mounts fs (if needed) and on shutdown it should do all necessary cleanup. -- Mikolaj Golub