From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Fiona Ebner <f.ebner@proxmox.com>, pve-devel@lists.proxmox.com
Subject: Re: [pve-devel] [PATCH storage 1/2] zfs: only use cache when listing images locally
Date: Tue, 29 Nov 2022 10:50:11 +0100 [thread overview]
Message-ID: <1669714828.ttb877ova7.astroid@yuna.none> (raw)
In-Reply-To: <174e5f00-af58-d440-6e87-a194526bc400@proxmox.com>
On November 28, 2022 1:19 pm, Fiona Ebner wrote:
> Am 16.11.22 um 14:30 schrieb Fiona Ebner:
>> Am 16.11.22 um 12:18 schrieb Fabian Grünbichler:
>>> On November 7, 2022 12:00 pm, Fiona Ebner wrote:
>>>> The plugin for remote ZFS storages currently also uses the same
>>>> list_images() as the plugin for local ZFS storages. The issue with
>>>> this is that there is only one cache which does not remember the
>>>> target host where the information originated.
>>>>
>>>> Simply restrict the cache to be used for the local ZFS plugin only. An
>>>> alternative solution would be to use a cache for each target host, but
>>>> that seems a bit more involved and could still be added in the future.
>>>
>>> wouldn't it be sufficient to just do
>>>
>>> $cache->{zfs}->{$storeid}
>>>
>>> when filling/querying the cache, and combining that with *always* listing only
>>> the storage-relevant pool?
>>
>> Yes, should work. I'll send a v2 with that.
>>
>
> Well, a $storeid-based cache would be useless for both existing callers
> using a cache parameter (pvesr's prepare_local_job and Storage.pm's
> vdisk_list), because they iterate over the storages once for a given cache.
the vdisk_list one is one-off actions only anyway, so there no cache or possibly
more overhead for multiple run_command executions is not that bad (compared to
the overhead of querying multiple pools while only being interested in one!).
for replication, I guess in most cases this will be a single storage anyway,
unless we frequently pass in unrelated storages for scanning?
> Should I get rid of the cache here entirely or do we go with this series
> after all?
judgment call I guess ;)
> Also, I guess pvesr should switch to using Storage.pm's interface,
> rather than talk to the plugin directly.
yes. this should be a general rule (which is broken in some parts of our code
atm) -> PVE::Storage is the interface to talk to storages, and that (and some
other code in pve-storage) uses the plugins. might require some re-working
though, but with other storage types up for replication in the near future
putting some (more) parts behind an abstraction in pve-storage if needed seems
sensible anyway ;)
prev parent reply other threads:[~2022-11-29 9:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-07 11:00 Fiona Ebner
2022-11-07 11:00 ` [pve-devel] [PATCH storage 2/2] zfs: list zvol: list single pool only for remote ZFS Fiona Ebner
2022-11-16 11:18 ` [pve-devel] [PATCH storage 1/2] zfs: only use cache when listing images locally Fabian Grünbichler
2022-11-16 13:30 ` Fiona Ebner
2022-11-28 12:19 ` Fiona Ebner
2022-11-29 9:50 ` Fabian Grünbichler [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1669714828.ttb877ova7.astroid@yuna.none \
--to=f.gruenbichler@proxmox.com \
--cc=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox