openzfs / zfs

OpenZFS on Linux and FreeBSD
https://openzfs.github.io/openzfs-docs
Other
10.47k stars 1.74k forks source link

l2arc devices can be added twice #9153

Closed devZer0 closed 2 years ago

devZer0 commented 5 years ago

Distribution Name | Centos Distribution Version | 7 Linux Kernel | 3.10.0-957.27.2.el7.x86_64 Architecture | x86_64 ZFS Version | 0.8.1 SPL Version | 0.8.1

i added l2arc to my pool and accidentally added device sdk twice (copy/paste error)

# zpool add zfspool cache sdk sdk

for my curiousity, zpool command ate that and it results in "corrupted" cache device.

i think there should be generic security measure in zpool command to avoid adding devices twice, especially when adding slog exactly gives the expected error.

# zpool add zfspool log sdl sdl
cannot add to 'zfspool': one or more vdevs refer to the same device

so, this is inconsistent behaviour

[root@nfs-test ~]# zpool status -v 1
  pool: zfspool
 state: ONLINE
status: One or more devices could not be used because the label is missing or
    invalid.  Sufficient replicas exist for the pool to continue
    functioning in a degraded state.
action: Replace the device using 'zpool replace'.
   see: http://zfsonlinux.org/msg/ZFS-8000-4J
  scan: none requested
config:

    NAME        STATE     READ WRITE CKSUM
    zfspool     ONLINE       0     0     0
      raidz2-0  ONLINE       0     0     0
        sdb     ONLINE       0     0     0
        sdc     ONLINE       0     0     0
        sdd     ONLINE       0     0     0
        sde     ONLINE       0     0     0
        sdf     ONLINE       0     0     0
        sdg     ONLINE       0     0     0
    logs
      sdh       ONLINE       0     0     0
      sdi       ONLINE       0     0     0
    cache
      sdk       FAULTED      0     0     0  corrupted data
      sdk       ONLINE       0     0     0

errors: No known data errors
stale[bot] commented 4 years ago

This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions.

devZer0 commented 4 years ago

sorry, but how can a bugreport which is being officially marked as "defect" getting closed (or at least being announced getting closed) by a robot because there is no activity for a while? sorry, that makes no sense to me!

stale[bot] commented 3 years ago

This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions.

devZer0 commented 3 years ago

@behlendorf , issues tagged with type Defect please should not get Stale label.

i can understand that stale bot can make developers life easier, as it is automatically decreasing ticket count and helps keeping focus on the important stuff..

but please also keep in mind that stalebot may delete volunteer work without empathy.

people wo report bugs want to help making things better or seek for help.

if their bugreport isn't getting cared or even noticed and then closed by a bot may scare them away....

behlendorf commented 3 years ago

Thanks for commenting, I can see your point about how the stale bot may be off putting to volunteers.

For what it's worth, I personally find that one of the main advantages is that prompts me (and others) to revisit and reassess old issues which might otherwise have gotten lost. And if it gets a little too zealous it's easy to reopen an issue, so nothing ever really gets deleted.

I think there's definitely room to improve its behavior. Perhaps that could be something as simple as changing the initial message it posts. Perhaps something along the lines of this issue hasn't gotten much attention in a while and it would be a good opportunity for the reporter and developers to revisit it.

For example, I think this is still a valid issue but I'm really not sure. It was originally filed against 0.8.1 and a fair bit of code in this area has changed, so it may be that was fixed but other changes and it would be helpful to reconfirm it it really is an issue with the latest tagged release.