Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Mar 2011 14:11:19 -0700
From:      Freddie Cash <fjwcash@gmail.com>
To:        Mikolaj Golub <to.my.trociny@gmail.com>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: HAST + ZFS causes system to shutdown uncleanly?
Message-ID:  <AANLkTik-gyuhKQTgEvw6XntfWjzrpongW0TGKP9EbqO8@mail.gmail.com>
In-Reply-To: <8662rgrvp8.fsf@kopusha.home.net>
References:  <AANLkTim5Brtn6nn=HJzB_eQGBg-Va4fXc5wSdvs5Y0kQ@mail.gmail.com> <AANLkTikh=svOS-HYPop5ieVxf3cuUUc8V=h=5xXt6-A5@mail.gmail.com> <AANLkTimStVjbmiAZdR8-wbQyj8e0Rorjb=Vz-WxbYiCq@mail.gmail.com> <8662rgrvp8.fsf@kopusha.home.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Mar 18, 2011 at 1:59 PM, Mikolaj Golub <to.my.trociny@gmail.com> wr=
ote:
> On Thu, 17 Mar 2011 13:42:09 -0700 Freddie Cash wrote:
> =C2=A0FC> On Thu, Mar 17, 2011 at 1:36 PM, Freddie Cash <fjwcash@gmail.co=
m> wrote:
> =C2=A0>> On Thu, Mar 17, 2011 at 12:32 PM, Thomas Johnson <tom@claimlynx.=
com> wrote:
> =C2=A0>>> Has anyone else noticed issues halting a system that is configu=
red with a
> =C2=A0>>> ZFS filesystem on a HAST device? I am using HAST to replicate a=
 ZFS
> =C2=A0>>> filesystem between two ESXi virtual machines (trying to emulate=
 our
> =C2=A0>>> production systems in a test environment) and I've noticed that=
 the system
> =C2=A0>>> doesn't seem to shutdown completely in this arrangement (hangs =
after ""
> =C2=A0>>> message). I did some poking around and learned that if I unmoun=
t my zfs
> =C2=A0>>> filesystems before shutdown, the shutdown finishes cleanly. Mud=
dling my way
> =C2=A0>>> through the rc scripts, it looks like hastd is killed fairly ea=
rly on in the
> =C2=A0>>> shutdown sequence. Presumably this is preventing the system fro=
m
> =C2=A0>>> syncing/unmounting the ZFS mounts, causing the shutdown to hang=
.
> =C2=A0>>>
> =C2=A0>>> Does this seem plausible? If so, any ideas on fix, besides maki=
ng sure I
> =C2=A0>>> 'zfs unmount -a' before shutdown?
> =C2=A0>>
> =C2=A0>> Does it work if you manually add "hastd" to the REQUIRE: line in=
 /etc/rc.d/zfs?
> =C2=A0>>
> =C2=A0>> Of course, that only works if you are starting zfs automatically=
 via
> =C2=A0>> /etc/rc.conf, and not letting CARP/devd or something else manage=
 the
> =C2=A0>> pool import process.
>
> =C2=A0FC> Thinking about it, perhaps we need a hook into the top of the
> =C2=A0FC> hastd_stop_precmd() function in /etc/rc.d/hastd?
>
> =C2=A0FC> Something like "hastd_stop_args" in /etc/rc.conf where we can p=
ut
> =C2=A0FC> commands to be run before hastd is stopped?
>
> =C2=A0FC> Then it would be as simple as putting hastd_stop_args=3D"zfs un=
mount -a"
> =C2=A0FC> into /etc/rc.conf.
>
> =C2=A0FC> Or something along those lines, so that we stop any consumers o=
f the
> =C2=A0FC> /dev/hast/* devices before we stop the hast daemon.
>
> IMHO, it is not HAST job to bother with such things. We always have somet=
hing
> (heartbeat, carp, hastmon) to manage HAST (change role, mount fs, start
> applications). This something has it own rc scripts, on startup it sets r=
oles
> and mounts fs (if needed) and on shutdown it should do all necessary clea=
nup.

Unless I'm missing something here, this has nothing to do with
shutting off the master node in a HAST setup, where the ZFS pool is
mounted, when the slave node is already offline.

As far as CARP, devd, heartbeat, etc are concerned, everything is up
and running correctly.  No need to unmount the pool, as it's not
switching to slave mode.

Or, are you suggesting that part of the "shutdown procedure" would be
to switch it to slave first, then shutdown?


--=20
Freddie Cash
fjwcash@gmail.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTik-gyuhKQTgEvw6XntfWjzrpongW0TGKP9EbqO8>