Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Dec 2019 11:26:06 +0700
From:      Eugene Grosbein <eugen@grosbein.net>
To:        Scott Bennett <bennett@sdf.org>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: Slow zfs destroy
Message-ID:  <3a51f9be-7eb8-21a7-b418-580dae58f189@grosbein.net>
In-Reply-To: <201911291757.xATHv1P1003382@sdf.org>
References:  <201911291757.xATHv1P1003382@sdf.org>

next in thread | previous in thread | raw e-mail | index | archive | help
30.11.2019 0:57, Scott Bennett wrote:

>      On Thu, 28 Nov 2019 23:18:37 +0700 Eugene Grosbein <eugen@grosbein.net>
> wrote:
> 
>> 28.11.2019 20:34, Steven Hartland wrote:
>>
>>> It may well depend on the extent of the deletes occurring.
>>>
>>> Have you tried disabling TRIM to see if it eliminates the delay?
>>
>> This system used mfi(4) first and mfi(4) does not support TRIM at all. Performance was abysmal.
>> Now it uses mrsas(4) and after switch I ran trim(8) for all SSDs one-by-one then re-added them to RAID1.
>> Disabling TRIM is not an option.
>>
>> Almost a year has passed since then and I suspect SSDs have no or a few spare trimmed cells for some reason.
>> Is there documented way to check this out? Maybe some SMART attribute?
>>
>      You neglected to state whether you used "zfs destroy datasetname" or
> "zfs destroy -d datasetname".  If you used the former, then ZFS did what
> you told it to do.  If you want the data set destroyed in the background,
> you will need to include the "-d" option in the command.  (See the zfs(1)
> man page at defer_destroy under "Native Properties".)

The manual says "zfs destroy -d" is not for "background" but for "deferred".
The "zfs destroy" without -d would return EBUSY for a snapshot on hold (zfs hold)
or bound with a clone, but "zfs destroy -d" would mark the snapshot for later destruction
in a moment the clone is deleted or user lock (hold) is lifted.
Until then the snapshot still usable and destruction does not happen.

All my snapshots are free from holds or clones and can be deleted,
so "zfs destroy -d" is equal to "zfs destroy" for them.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3a51f9be-7eb8-21a7-b418-580dae58f189>