On Sep 16 2022, Archie Cobbs <
archie...@gmail.com> wrote:
> On Fri, Sep 16, 2022 at 3:02 AM Nikolaus Rath <
Niko...@rath.org> wrote:
>
>> What do you think about the approach used by nbdkit's S3 plugin for
>> trimming? It starts by issuing a scoped LIST request that returns only
>> objects within the range that is to be trimmed.
>
>
> I'm still not convinced that it's worth it, practically speaking.
>
> A basic question is this: in what scenarios would you NOT want to use
> --listBlocks and why?
Me personally? All the time, for reasons of algorithmic elegance.
The current S3QL behavior (download/upload a full SQLite DB on
mount/umount) does not cause me problems in practice either, but I still
dislike it immensely :-).
> Another question is: when are you going to be in a situation where a
> filesystem is asking to TRIM a bunch of blocks that are already zero?
Definitely when working with the block device directly (e.g. through
mkfs.ext4 or LVM). I suspect that `zpool trim` is not keeping track of which
blocks it has already discarded and just trims everything that's
currently not used.
> It seems like in normal usage a filesystem only TRIM's blocks that it is
> deallocating, which means that they are (very likely to be) not currently
> zero.
I think in normal file system usage, trim's are not used at all. At
least on Debian, the default setup is to have an `fstrim` call in
crontab (IIRC for performance reasons this is preferably than having
trimming intersect regular filesystem ops).
>> In the best case, where none of the objects exist, we save thousands of
>> pointless DELETE requests.
>
> We don't delete one-by-one anymore, we use bulk delete in which you POST to
>
https://blah?delete with a <Delete> XML payload containing up to 1000
> blocks at once. So this has gotten more efficient since 1.6.3.
Point taken. In that case the gains are indeed much less. But I'll be
honest - for me it's less about practical gains and more about elegance
of the approach.