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

zil: add stats for commit failure/fallback #16315

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

robn
Copy link
Member

@robn robn commented Jun 30, 2024

[Sponsors: Klara, Inc., Wasabi Technology, Inc.]

Motivation and Context

There's no good way to tell when a ZIL commit fails and falls back to a transaction sync, other than perhaps a throughput drop. This adds counters so we can see when it happens and why.

Description

Adds three new counters to the zil kstat for each of the three places where a ZIL commit can fail and fall back to a full sync. From the comments:

  • error: ZIL IO (write/flush) returned an error (see zil_commit_impl())
  • stall: LWB block allocation failed, ZIL chain abandoned (see zil_commit_writer_stall())
  • suspend: Commit was requested but ZIL suspended (see zil_commit())
# grep ^zil_commit /proc/spl/kstat/zfs/zil
zil_commit_count                4    0
zil_commit_writer_count         4    0
zil_commit_error_count          4    0
zil_commit_stall_count          4    0
zil_commit_suspend_count         4    0

How Has This Been Tested?

Manual. These stats are also used to implement a test case for a PR to change flush behaviour that I'm about to post.

Full ZTS run completed successfully.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

Copy link
Member

@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.

It looks OK. I am not sure if I like "wait" separate from "suspend", since it is just a different way to detect the same.

You could add these stats into zilstat for completeness.

@robn robn force-pushed the zil-commit-fallback-stats branch from d63779d to c56177d Compare July 1, 2024 01:08
@robn
Copy link
Member Author

robn commented Jul 1, 2024

It looks OK. I am not sure if I like "wait" separate from "suspend", since it is just a different way to detect the same.

Ahh, good point, I'd missed that subtlety. They're not both suspend.

You could add these stats into zilstat for completeness.

I always forget this exists! Added.

@robn robn force-pushed the zil-commit-fallback-stats branch from c56177d to a4f666b Compare July 1, 2024 01:11
@robn robn force-pushed the zil-commit-fallback-stats branch from a4f666b to b310029 Compare July 11, 2024 04:28
There's no good way to tell when a ZIL commit fails and falls back to a
transaction sync, other than perhaps a throughput drop. This adds
counters so we can see when it happens and why.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Signed-off-by: Rob Norris <[email protected]>
@tonyhutter tonyhutter merged commit 7ddc1f7 into openzfs:master Jul 25, 2024
22 of 25 checks passed
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Sep 4, 2024
There's no good way to tell when a ZIL commit fails and falls back to a
transaction sync, other than perhaps a throughput drop. This adds
counters so we can see when it happens and why.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.

Signed-off-by: Rob Norris <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
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.

3 participants