Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Apr 2020 14:26:20 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Peter Eriksson <pen@lysator.liu.se>, freebsd-fs <freebsd-fs@freebsd.org>
Subject:   Re: ZFS server has gone crazy slow
Message-ID:  <575c01de-b503-f4f9-2f13-f57f428f53ec@FreeBSD.org>
In-Reply-To: <FE84C045-89B1-4772-AF1F-35F78B9877D8@lysator.liu.se>
References:  <2182C27C-A5D3-41BF-9CE9-7C6883E43074@distal.com> <20200411174831.GA54397@fuz.su> <6190573D-BCA7-44F9-86BD-0DCBB1F69D1D@distal.com> <6fd7a561-462e-242d-5057-51c52d716d68@wp.pl> <7AA1EA07-6041-464A-A39A-158ACD1DC11C@distal.com> <FE84C045-89B1-4772-AF1F-35F78B9877D8@lysator.liu.se>

next in thread | previous in thread | raw e-mail | index | archive | help

On 12/04/2020 00:24, Peter Eriksson wrote:
> Another fun thing that might happen is if you reboot your server and happen
> to have a lot of queued up writes in the ZIL (for example if you did a “zfs
> destroy -d -r POOL@snapshots” (deferred(background) destroys of snapshots)
> and do a hard reboot while it’s busy it will “write out” those queued
> transactions at filesystem mount time during the boot sequence

Just nitpicking on two bits of incorrect information here.
First, zfs destroy never uses ZIL.  Never.  ZIL is used only for ZPL operations
like file writes, renames, removes, etc.  The things that you can do with Posix
system calls (~ VFS KPI).

Second, zfs destroy -d is not a background destroy.  It is a deferred destroy.
That means that either the destroy is done immediately if a snapshot has no
holds which means no user holds and no clones.  Or the destroy is postponed
until holds are gone, that is, the last clone or the last user hold is removed.

Note, however, that unless you have a very ancient pool version destroying a
snapshot means that the snapshot object is removed and all blocks belonging to
the snapshot are queued for freeing.  Their actual freeing is done
asynchronously ("in background") and can be spread over multiple TXG periods.
That's done regardless of whether -d was used.

-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?575c01de-b503-f4f9-2f13-f57f428f53ec>