-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Volume information caching in $scfg #15
Comments
Since I now have write access, do you want me to post verified commits directly to main branch or still do a PR? |
If I understand correctly, caching works within the scope of a single API call. Yes, this can be risky, which is why the cache should be cleared when creating or modifying data. However, without caching, the UI becomes very laggy. With a large number of volumes, using the UI becomes challenging. For example, list_volumes is triggered when opening a window related to adding or modifying a disk. Caching is a necessity; I agree that in its current form, it is not very efficient and definetly requires improvement.
For main branch PR please. |
Caching of volume info in We could potentially cache volumes info in I looked into |
My thoughts: I think cache must be file based. File can be places under
On volume change/add/delete call - cache reset. At this level race condition is not important, but if cache will be added to another functions then lock need to be implemented PS I am not a perl developer, so there is a big question what is the best way to implement cache |
The current PVE Storage library does not maintain internal storage configuration state. Any high-level call, whether through the GUI or command line, creates a new storage configuration instance, resetting all parameters.
For example, running any storage-related
qm
command reinitializes all storage plugins, which also occurs with GUI actions. This can be observed in the debug output - cached authentication tokens for arrays are lost between actions (e.g. try resizing the same disk twice).As a result, caching volume information is mostly ineffective (except in cases like
list_images()
whenStorage.pm
itself supplies the short-lived$cache
variable). It introduces unnecessary complexity and could lead to out-of-sync caches in different instances of the same storage plugin, which is risky.It's unclear whether this behavior is intentional or an oversight by the developers. We might want to open a ticket.
Ultimately, we should avoid caching volume information in the
$scfg
variable. While storing cached data in a static file (and re-reading it on the timestamp change) might be an option, it is simply not worth it.After merging my forthcoming changes, we should remove the
$scfg->{cache}
logic entirely.The text was updated successfully, but these errors were encountered: