SiaFoundation/web

Filter on usable

Closed this issue · 3 comments

Support filtering hosts in renterd by ones that are usable based on the usable column

Very much agreed, please add this issue to the renterd repository so the renterd team can prioritize and make the necessary changes. Thanks!

@alexfreska wouldn't it be better to filter hosts on the client side? There are no optimisations we can perform on the backend to filter for usable hosts. The autopilot fetches all hosts from the bus and then determines whether they are considered usable because the bus simply doesn't know.
Since the UI already fetches all hosts from the autopilot anyway it might make sense to use those "cached" hosts and hide the ones that aren't usable.

@ChrisSchinnerl the UI actually does not fetch all the hosts, it uses the APIs existing filters and pagination to fetch 100 records at a time. The UI does fetch all the active contracts and does client side filtering on those, but contracts are on the order of 100, vs hosts which is more like 100,000.

Also I think a standardized usable filter in combination with other filters and pagination would be useful to API consumers beyond the UI - most people that have tried renterd have requested this filter because it is the natural view (maybe even should be the default) you would expect from a host db search endpoint - in its current form the endpoint isn't very useful (besides when the active contracts filter is applied) because results are mostly unusable/offline hosts.

I see what you mean that the entire dataset does need to be pulled in and filtered on the autopilot side, but I think it would be worthwhile because once this pattern is set up, there are more highly useful filters we could then add over time to get a really useful (to all future API consumers and for us developers debugging autopilot) search endpoint that provides "autopilot's view" of the host db. Off the top of my head just based on what already exists, filtering on the overall or specific scores would be nice.

We can punt it down the road a bit but I think it will continue to be highly requested by users of the host search endpoint.