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

Inconsistent numbering of spares in use #735

Closed
pyavdr opened this issue May 10, 2012 · 1 comment
Closed

Inconsistent numbering of spares in use #735

pyavdr opened this issue May 10, 2012 · 1 comment
Labels
Type: Documentation Indicates a requested change to the documentation
Milestone

Comments

@pyavdr
Copy link
Contributor

pyavdr commented May 10, 2012

For testing i am using a zpool with 400 vdevs (files) and 5 spares, i replaced 3 vdevs with spares triggering resilvering.
While resilvering with a replaced spare, the identifier for the spare in use/replaced seem to be wrong numbered.
Suddenly there is a spare-18 and a spare-19 and a spare-0. For my feeling there should only be spare-0 through spare-5 if no more spares are defined.

       partially zpool status output:
        /stor1/zfstest2/vfil377    ONLINE       0     0     0
        /stor1/zfstest2/vfil378    ONLINE       0     0     0
        /stor1/zfstest2/vfil379    ONLINE       0     0     0
        spare-19                   ONLINE       0     0     0
          /stor1/zfstest2/vfil380  ONLINE       0     0     0
          /stor1/zfstest2/vfil425  ONLINE       0     0     0  (resilvering)
      raidz3-19                    ONLINE       0     0     0
        /stor1/zfstest2/vfil381    ONLINE       0     0     0
        /stor1/zfstest2/vfil382    ONLINE       0     0     0
        /stor1/zfstest2/vfil383    ONLINE       0     0     0
        /stor1/zfstest2/vfil384    ONLINE       0     0     0
        /stor1/zfstest2/vfil385    ONLINE       0     0     0
        /stor1/zfstest2/vfil386    ONLINE       0     0     0
        /stor1/zfstest2/vfil387    ONLINE       0     0     0
        /stor1/zfstest2/vfil388    ONLINE       0     0     0
        /stor1/zfstest2/vfil389    ONLINE       0     0     0
        /stor1/zfstest2/vfil390    ONLINE       0     0     0
        /stor1/zfstest2/vfil391    ONLINE       0     0     0
        /stor1/zfstest2/vfil392    ONLINE       0     0     0
        /stor1/zfstest2/vfil393    ONLINE       0     0     0
        /stor1/zfstest2/vfil394    ONLINE       0     0     0
        /stor1/zfstest2/vfil395    ONLINE       0     0     0
        /stor1/zfstest2/vfil396    ONLINE       0     0     0
        /stor1/zfstest2/vfil397    ONLINE       0     0     0
        /stor1/zfstest2/vfil398    ONLINE       0     0     0
        spare-18                   ONLINE       0     0     0
          /stor1/zfstest2/vfil399  ONLINE       0     0     0
          /stor1/zfstest2/vfil424  ONLINE       0     0     0  (resilvering)
        /stor1/zfstest2/vfil400    ONLINE       0     0     0
      raidz3-20                    ONLINE       0     0     0
        spare-0                    ONLINE       0     0     0
          /stor1/zfstest2/vfil401  ONLINE       0     0     0
          /stor1/zfstest2/vfil423  ONLINE       0     0     0  (resilvering)
        /stor1/zfstest2/vfil402    ONLINE       0     0     0
        /stor1/zfstest2/vfil403    ONLINE       0     0     0
        /stor1/zfstest2/vfil404    ONLINE       0     0     0
        /stor1/zfstest2/vfil405    ONLINE       0     0     0
        /stor1/zfstest2/vfil406    ONLINE       0     0     0
        /stor1/zfstest2/vfil407    ONLINE       0     0     0
        /stor1/zfstest2/vfil408    ONLINE       0     0     0
        /stor1/zfstest2/vfil409    ONLINE       0     0     0
        /stor1/zfstest2/vfil410    ONLINE       0     0     0
        /stor1/zfstest2/vfil411    ONLINE       0     0     0
        /stor1/zfstest2/vfil412    ONLINE       0     0     0
        /stor1/zfstest2/vfil413    ONLINE       0     0     0
        /stor1/zfstest2/vfil414    ONLINE       0     0     0
        /stor1/zfstest2/vfil415    ONLINE       0     0     0
        /stor1/zfstest2/vfil416    ONLINE       0     0     0
        /stor1/zfstest2/vfil417    ONLINE       0     0     0
        /stor1/zfstest2/vfil418    ONLINE       0     0     0
        /stor1/zfstest2/vfil419    ONLINE       0     0     0
        /stor1/zfstest2/vfil420    ONLINE       0     0     0
    spares
      /stor1/zfstest2/vfil423      INUSE     currently in use
      /stor1/zfstest2/vfil424      INUSE     currently in use
      /stor1/zfstest2/vfil425      INUSE     currently in use
      /stor1/zfstest2/vfil426      AVAIL   
      /stor1/zfstest2/vfil427      AVAIL   
@behlendorf
Copy link
Contributor

The code here is working as intended but the numbering may be non-obvious so let me explain. The suffix appended to interior vdevs (mirror, raidz, spare, etc) is the child number in the vdev parent. It has nothing to do with the specific spare which was used. Notice that in your example above the number always reflects the location in parent raidz3 vdev. Here's a simpler example.

  pool: tank
 state: ONLINE
  scan: resilvered 40K in 0h0m with 0 errors on Fri Mar  1 13:58:30 2013
config:

        NAME        STATE     READ WRITE CKSUM
        tank        ONLINE       0     0     0
          v0        ONLINE       0     0     0
          v1        ONLINE       0     0     0
          spare-2   ONLINE       0     0     0
            v2      ONLINE       0     0     0
            v3      ONLINE       0     0     0
        spares
          v3        INUSE     currently in use

I'm closing this issue because this is the expected behavior and must remain this way to be consistent with the other implementations.

pcd1193182 pushed a commit to pcd1193182/zfs that referenced this issue Sep 26, 2023
)

Bumps [sysinfo](https://github.com/GuillaumeGomez/sysinfo) from 0.26.0 to 0.28.1.
- [Release notes](https://github.com/GuillaumeGomez/sysinfo/releases)
- [Changelog](https://github.com/GuillaumeGomez/sysinfo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/GuillaumeGomez/sysinfo/commits)

---
updated-dependencies:
- dependency-name: sysinfo
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Documentation Indicates a requested change to the documentation
Projects
None yet
Development

No branches or pull requests

2 participants