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

NAS-125883 / 24.04 / Account for pss_skipped in scan progress #251

Merged
merged 2 commits into from
Jan 17, 2024

Conversation

themylogin
Copy link
Contributor

No description provided.

@themylogin themylogin requested a review from a team January 4, 2024 12:15
@themylogin
Copy link
Contributor Author

time 1:00

@bugclerk bugclerk changed the title Account for pss_skipped in scan progress NAS-125883 / 24.04 / Account for pss_skipped in scan progress Jan 4, 2024
@bugclerk
Copy link

bugclerk commented Jan 4, 2024

libzfs.pyx Show resolved Hide resolved
themylogin added a commit to truenas/zfs that referenced this pull request Jan 4, 2024
@themylogin themylogin force-pushed the NAS-125883 branch 2 times, most recently from 9044011 to 6780df8 Compare January 12, 2024 12:32
@themylogin
Copy link
Contributor Author

time 1:00

@themylogin themylogin requested a review from yocalebo January 12, 2024 12:48
@yocalebo yocalebo requested a review from ixhamza January 12, 2024 14:33
libzfs.pyx Outdated
@@ -2644,7 +2649,7 @@ cdef class ZPoolScrub(object):
if not self.bytes_to_scan:
return 0

return (<float>self.bytes_issued / <float>self.bytes_to_scan) * 100
return (<float>self.bytes_issued / (<float>self.bytes_to_scan - <float>self.bytes_skipped)) * 100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In zpool I also check for bytes_to_scan > bytes_skipped to avoid division by zero, but it should probably be extremely rare, if ever happen.

Copy link
Contributor

@yocalebo yocalebo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amotin i approve but does this look good to you?

Copy link
Contributor

@amotin amotin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose 'if not self.bytes_to_scan:' is no longer needed. It protected from the divisions by zero before, just condition has changed.

But generally it looks good to me.

@themylogin themylogin merged commit 143b624 into master Jan 17, 2024
1 check passed
@themylogin themylogin deleted the NAS-125883 branch January 17, 2024 16:41
@bugclerk
Copy link

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators Jan 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants