NAS-128752 / 24.10 / fix catalog.query to stop calling zfs.dataset.query (by yocalebo) #13660
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
24.04.0 was released to the wild and we immediately got reports of increased CPU usage when browsing to the APPs web page. The UI team found that they had made a mistake by calling
chart.release.query
in a tight loop. While this is the "cause" of the increased CPU usage, it's not the root of why it's occurring. Further investigation showed me a cascading set of problems that built on one another.chart.release.query
in a tight loopchart.release.query
calledcatalog.query
catalog.query
calledzfs.dataset.query
zfs.dataset.query
is in the zfs plugin, so it gets executed in our process poolThe UI team has fixed their problem, but there was an underlying design issue with
catalog.query
. It shouldn't be callingzfs.dataset.query
especially because of the information it was getting. To fix the design issue, I use theself.dataset_mounted
method which does not use our process pool and is 100x faster. This should prevent the aforementioned process pool exhaustion scenario but also improve thechart.release.query
(and subsequentlycatalog.query
) calls as well.Original PR: #13659
Jira URL: https://ixsystems.atlassian.net/browse/NAS-128752