Skip to content
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

The zpool_influxdb command outputs incorrect information for the the scan time remaining #16771

Open
ajaxous opened this issue Nov 16, 2024 · 0 comments
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@ajaxous
Copy link

ajaxous commented Nov 16, 2024

System information

Type Version/Name
Distribution Name Fedora
Distribution Version 39
Kernel Version 6.10.12-100
Architecture x86-64
OpenZFS Version 2.2.6

Describe the problem you're observing

The value for remaining_t as reported by zpool_influxdb --no-histograms in the zpool_scan_stats section is not correct.

Describe how to reproduce the problem

Just run the command above during a scan

The root cause appears to be ~line 223 in zpool_influxdb.c :

remaining_time = ps->pss_to_examine - examined / rate;

The code is subtracting a unit of seconds (examined / rate) from a unit of bytes (ps->pss_to_examine ).

I believe the correct equation would be to divide the difference by the rate:

remaining_time = ( ps->pss_to_examine - examined ) / rate;

Include any warning/errors/backtraces from the system logs

@ajaxous ajaxous added the Type: Defect Incorrect behavior (e.g. crash, hang) label Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

No branches or pull requests

1 participant