-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
zdb: show BRT statistics and dump its contents #15541
Conversation
So that zdb (and others!) can get at the BRT on-disk structures. Signed-off-by: Rob Norris <robn@despairlabs.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not super happy with -T
as option, but the most other letters are in use already. But nice work. Maybe this also helps to trace down the double write problem.
Is there a way for a user to associate the output of this with individual files? |
Yeah, I didn't love it either, but it seemed the best of what was left. We'll have to do something about that soon (I've some ideas and plans) but its bigger than this PR of course. |
You'd need to do something like, dump the BRT, extract the DVAs to a file, then use
|
Same idea as the dedup stats, but for block cloning. Signed-off-by: Rob Norris <robn@despairlabs.com>
I successfully built zdb with this PR, and managed to get filenames from the dump using robn's instructions. |
@0x5c that's neat, nice work! |
@robn Two days ago I cloned a pool with
Q1: Do I understand it right, that the send|receive has no impact on cloned data and the |
@FL140 send and receive doesn't support replay block cloning to the current time. |
That is not good news, as detection in any way can only happen on the original source file system then, but thank's for the clarification! |
Same idea as the dedup stats, but for block cloning. Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Kay Pedersen <mail@mkwg.de> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #15541
Same idea as the dedup stats, but for block cloning. Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Kay Pedersen <mail@mkwg.de> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes openzfs#15541
So that zdb (and others!) can get at the BRT on-disk structures. Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Kay Pedersen <mail@mkwg.de> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes openzfs#15541
Same idea as the dedup stats, but for block cloning. Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Kay Pedersen <mail@mkwg.de> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes openzfs#15541
So that zdb (and others!) can get at the BRT on-disk structures. Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Kay Pedersen <mail@mkwg.de> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #15541
Same idea as the dedup stats, but for block cloning. Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Kay Pedersen <mail@mkwg.de> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #15541
So that zdb (and others!) can get at the BRT on-disk structures. Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Kay Pedersen <mail@mkwg.de> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes openzfs#15541
Same idea as the dedup stats, but for block cloning. Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Kay Pedersen <mail@mkwg.de> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes openzfs#15541
Motivation and Context
Mostly, its good to have ways to look inside every ZFS subsystem to see how its doing, and BRT was lacking there. In particular though, being able to dump the contents may at least have some utility in recovering from some of the recent cloning-adjacent bugs.
Description
Adds a
-T
switch tozdb
that acts rather like-D
, except for the BRT.-T
: show some top-level stats-TT
: also show per-vdev stats-TTT
also dump the tableI've lifted the internal structures out of
brt.c
intobrt_impl.h
so thatzdb
can get at them. I don't use most of it, but it seems better to move them all and is consistent with other_impl.h
files.How Has This Been Tested?
Make a file, and clone it a bit:
Types of changes
Checklist:
Signed-off-by
.