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

Improved zpool status output, list all affected datasets #12812

Merged
merged 1 commit into from
Apr 26, 2022

Commits on Apr 21, 2022

  1. Improve zpool status output, list all affected datasets

    Currently, determining which datasets are affected by corruption is
    a manual process.
    
    The primary difficulty in reporting the list of affected snapshots is
    that since the error was initially found, the snapshot where the error
    originally occurred in, may have been deleted. To solve this issue, we
    add the ID of the head dataset of the original snapshot which the error
    was detected in, to the stored error report. Then any time a filesystem
    is deleted, the errors associated with it are deleted as well. Any time
    a clone promote occurs, we modify reports associated with the original
    head to refer to the new head. The stored error reports are identified
    by this head ID, the birth time of the block which the error occurred
    in, as well as some information about the error itself are also stored.
    
    Once this information is stored, we can find the set of datasets
    affected by an error by walking back the list of snapshots in the given
    head until we find one with the appropriate birth txg, and then traverse
    through the snapshots of the clone family, terminating a branch if the
    block was replaced in a given snapshot. Then we report this information
    back to libzfs, and to the zpool status command, where it is displayed
    as follows:
    
     pool: test
     state: ONLINE
    status: One or more devices has experienced an error resulting in data
            corruption.  Applications may be affected.
    action: Restore the file in question if possible.  Otherwise restore the
            entire pool from backup.
       see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-8A
      scan: scrub repaired 0B in 00:00:00 with 800 errors on Fri Dec  3
    08:27:57 2021
    config:
    
            NAME        STATE     READ WRITE CKSUM
            test        ONLINE       0     0     0
              sdb       ONLINE       0     0 1.58K
    
    errors: Permanent errors have been detected in the following files:
    
            test@1:/test.0.0
            /test/test.0.0
            /test/1clone/test.0.0
    
    A new feature flag is introduced to mark the presence of this change, as
    well as promotion and backwards compatibility logic. This is an updated
    version of openzfs#9175. Rebase required fixing the tests, updating the ABI of
    libzfs, updating the man pages, fixing bugs, fixing the error returns,
    and updating the old on-disk error logs to the new format when
    activating the feature.
    
    Co-authored-by: TulsiJain <tulsi.jain@delphix.com>
    Signed-off-by: George Amanakis <gamanakis@gmail.com>
    gamanakis and TulsiJain committed Apr 21, 2022
    Configuration menu
    Copy the full SHA
    5e7ae76 View commit details
    Browse the repository at this point in the history