mirror of
git://git.proxmox.com/git/pve-storage.git
synced 2025-01-24 02:04:13 +03:00
Fiona Ebner
c2e6a90d4f
zfs: list: only cache and list images for requested storage/pool
The plugin for remote ZFS storages currently also uses the same list_images() as the plugin for local ZFS storages. There is only one cache which does not remember the target host where the information originated. This is problematic for rescan in qemu-server: 1. Via list_images() and zfs_list_zvol(), ZFSPlugin.pm's zfs_request() is executed for a remote ZFS. 2. $cache->{zfs} is set to the result of scanning the images there. 3. Another list_images() for a local ZFS storage happens and uses the cache with the wrong information. The only two operations using the cache currently are 1. Disk rescan in qemu-server which is affected by the issue. It is done as part of (or as a) long-running operations. 2. prepare_local_job for pvesr, but the non-local ZFS plugin doesn't support replication, so it cannot trigger there. The cache only helps if there is a replicated guest with volumes on different ZFS storages, but otherwise it will be less efficient than no cache or querying every storage by itself. Fix the issue by making the cache $storeid-specific, which effectively makes the cache superfluous, because there is no caller using the same $storeid multiple times. As argued above, this should not really hurt the callers described above much and actually improves performance for all other callers. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Description
No description provided
Languages
Perl
99.2%
Makefile
0.7%