From owner-freebsd-fs@FreeBSD.ORG Thu Mar 17 20:42:10 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 7E485106566B for ; Thu, 17 Mar 2011 20:42:10 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3B36F8FC08 for ; Thu, 17 Mar 2011 20:42:09 +0000 (UTC) Received: by yxl31 with SMTP id 31so1470327yxl.13 for ; Thu, 17 Mar 2011 13:42:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=NRy2EdMLHmLAlRzQHuF8RCjIgY5P6wcyfjD4gY924B8=; b=ljX36Wps+Ct+YYXS8Mo+SIHJ/MR3p8IsP6i/L5HRIM2ztYzo6vXweusi03/bcUG0Eg AQQFxIoo7b2NAUEoptjzajpYu+0L3evazaDby8jpiAaQ6xHA9gAt0rkb2Gmd6kE1Uf1j waXMY+sycqWYv2sX8wAidz1Az1pFjpO0vn9wA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=yCCSViQ+na9Ug5d4CVNFJAdsd875URaRvAR4pdJjU+4bXB4kglIkIduOidUTBhf41N fW1BNAuf6VeQGl6prPxEOrwKUlHEx109XaaRCYqurxraCEBJvuFt29cPkTBjDeqkyvhy qWjH5AibAZxAR0tMz6vVLhrvxbx0rvE9QUp54= MIME-Version: 1.0 Received: by 10.91.79.12 with SMTP id g12mr283561agl.168.1300394529289; Thu, 17 Mar 2011 13:42:09 -0700 (PDT) Received: by 10.90.83.18 with HTTP; Thu, 17 Mar 2011 13:42:09 -0700 (PDT) In-Reply-To: References: Date: Thu, 17 Mar 2011 13:42:09 -0700 Message-ID: From: Freddie Cash To: Thomas Johnson Content-Type: text/plain; charset=UTF-8 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: Thu, 17 Mar 2011 20:42:10 -0000 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. Thinking about it, perhaps we need a hook into the top of the hastd_stop_precmd() function in /etc/rc.d/hastd? Something like "hastd_stop_args" in /etc/rc.conf where we can put commands to be run before hastd is stopped? Then it would be as simple as putting hastd_stop_args="zfs unmount -a" into /etc/rc.conf. Or something along those lines, so that we stop any consumers of the /dev/hast/* devices before we stop the hast daemon. -- Freddie Cash fjwcash@gmail.com