Skip to content

Commit

Permalink
Revert "optimize pool.dataset.details (#15436)"
Browse files Browse the repository at this point in the history
This reverts commit a8f5e99.
  • Loading branch information
yocalebo committed Jan 21, 2025
1 parent 21b2b89 commit 98dbade
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/middlewared/middlewared/plugins/pool_/dataset_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
PoolDatasetDetailsArgs,
PoolDatasetDetailsResults,
)
from middlewared.plugins.boot import BOOT_POOL_NAME_VALID
from middlewared.plugins.zfs_.utils import zvol_path_to_name, TNUserProp
from middlewared.service import Service, private
from middlewared.utils.mount import getmntinfo
from middlewared.utils.zfs import query_imported_fast_impl


class PoolDatasetService(Service):
Expand Down Expand Up @@ -53,13 +51,19 @@ def build_filters_and_options(self):
'snapshots_count': True,
}
}
valid_pools = list()
for i in query_imported_fast_impl().values():
if i['name'] not in BOOT_POOL_NAME_VALID:
valid_pools.append(i['name'])

return [['name', 'in', valid_pools]], options

# FIXME: this is querying boot-pool datasets
# because of how bad our pool.dataset.query API
# is designed. If boot pool has a few old BE's,
# then this endpoint slows down exponentially
# which makes sense, because we have like 10/11
# datasets on the boot drive. So multiply that
# value by number of BEs and you're asking ZFS
# for a bunch of unnecessary data.
# valid_pools = list()
# for i in query_imported_fast_impl().values():
# if i['name'] not in BOOT_POOL_NAME_VALID:
# valid_pools.append(i['name'])
return [], options

@api_method(
PoolDatasetDetailsArgs,
Expand Down

0 comments on commit 98dbade

Please sign in to comment.