Skip to content

oxlog: Glob match zone names #8008

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

oxlog: Glob match zone names #8008

wants to merge 1 commit into from

Conversation

wfchandler
Copy link
Contributor

@wfchandler wfchandler commented Apr 18, 2025

oxlog logs currently requires a precise match for the zone name. This
is inconvenient when attempting to search across multiple zones with
similar names. For example, when searching all Crucible downstairs, or
using Pilot to query Nexus logs on multiple sleds.

Use the glob crate to take a pattern to match against the zone name
for the services and logs subcommands, potentially allowing multiple
zones to be returned. If more than one zone is matched, then the logs
and services will be sorted globally.

Zones with a large number of archived logs may take a second or more to
sort, and when matching against multiple zones this becomes
uncomfortably slow. To claw back some performance, use Rayon to sort in
parallel. We limit the size of its thread pool to a maximum of 12
threads to avoid soaking up all available threads on a sled. On smaller
machines we fall back to the number of logical threads.

Example usage:

$ oxlog services 'oxz_crucible_[!p]*' # All non-pantry Crucible zones
$ oxlog logs 'oxz_nexus_*' --current  # The nexus zone

@wfchandler wfchandler force-pushed the wc/oxlog-glob-zones branch from 21d7e93 to a127df5 Compare April 21, 2025 15:29
@wfchandler wfchandler changed the title oxlog: Glob match zone names for 'logs' subcommand oxlog: Glob match zone names Apr 21, 2025
@wfchandler wfchandler force-pushed the wc/oxlog-glob-zones branch 2 times, most recently from c630c02 to 68c4778 Compare April 22, 2025 01:54
`oxlog logs` currently requires a precise match for the zone name. This
is inconvenient when attempting to search across multiple zones with
similar names. For example, when searching all Crucible downstairs, or
using Pilot to query Nexus logs on multiple sleds.

Use the `glob` crate to take a pattern to match against the zone name
for the `services` and `logs` subcommands, potentially allowing multiple
zones to be returned. If more than one zone is matched, then the logs
and services are sorted separately.

Zones with a large number of archived logs may take an extended period
to walk and sort, and when matching against multiple zones this becomes
uncomfortably slow. To claw back some performance, use Rayon to find
files and sort in parallel. We limit the size of its thread pool to a
maximum of eight threads to avoid soaking up all available threads on a
sled. On smaller machines we fall back to the number of logical threads.

Example usage:

  $ oxlog services 'oxz_crucible_[!p]*' # All non-pantry Crucible zones
  $ oxlog logs 'oxz_nexus_*' --current  # The nexus zone
@wfchandler wfchandler force-pushed the wc/oxlog-glob-zones branch from 68c4778 to 3c07c0e Compare April 22, 2025 13:57
@wfchandler wfchandler marked this pull request as ready for review April 24, 2025 13:58
@wfchandler wfchandler requested a review from leftwo April 24, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant