Project

General

Profile

Feature #2012

ZDB improvements for error-location (with greater verbosity)

Added by Jim Klimov about 8 years ago. Updated about 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
zfs - Zettabyte File System
Start date:
2012-01-21
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

When traversing an object's block tree with "zdb -ddddddd... pool dataset objnum" it might be useful to receive information on:

level-6 verbosity
1) Each L0 entry's offset in its L1 set of block pointers (i.e. when I extract the L1 block, I should research blkptr_t entry number 17 to get this' particular block's metadata); perhaps likewise for all higher-level indirect block pointers (offset of this L1 in its parent L2 and so on)
2) Output info about this block's compression, dedup
3) Output info about this block's checksum algorithm and value (from parent BP) and this block's on-disk data checksum for all copies/mirrors or raidz permutations (if none match the BP checksum);
3*) mark the mismatches with some greppable marker :)

level-7 verbosity
4) Output physical/leaf VDEV offset:size addresses for sectors which contain this block's data (mirror/copies or raidz strips with role - parity-1, data-3, etc.)

History

#1

Updated by Jim Klimov about 8 years ago

I looked into the code (usr/src/cmd/zdb/zdb.c) and found that sprintf_blkptr_compact() includes many (but not all) of the requested features if -ddddddd call is complemented by -bbbbb (5 or more), i.e.:

# zdb -dddddddd -bbbbbb rpool/ROOT/nightly-2012-01-31 260050

In this case sprintf_blkptr() is called (usr/src/uts/common/fs/zfs/spa_misc.c) ultimately calling the macro SPRINTF_BLKPTR (usr/src/uts/common/fs/zfs/sys/spa.h), instead of "normal" sprintf_blkptr_compact() output logic. In effect this outputs the complete blkptr_t information in readable form.

Regarding my RFE, this existing solution does not suffice for the following points:
6*-d:
1) child L(x) entry's offset in its parent L(x+1) block - absent
2) compression, dedup - ok (and more - gang info, etc.)
3) checksum algo and value from BP - ok;
checksums from on-disk block data (copies, mirrors, permutations) - absent
3*) visible/greppable marking of checksum mismatches - absent

7*-d:
4) Physical (LBA) addresses - absent

Also available in: Atom PDF