Open-CAS / open-cas-linux

Open CAS Linux
https://open-cas.com
BSD 3-Clause "New" or "Revised" License
222 stars 82 forks source link

Test activate standby cache on drbd passive node with cache id missmatch does not remain in standby state #1118

Closed pdebski21 closed 2 years ago

pdebski21 commented 2 years ago

Description

Test activate standby cache on drbd passive node with cache id missmatch does not remain in standby state and cache exported object dissappeares.

Expected Behavior

      - The activation is cancelled 
      - The cache remains in Standby detached state after an unsuccessful activation 
      - The cache exported object is present after an unsuccessful activation 
      - A proper error message is displayed

Actual Behavior

      ok - The activation is cancelled 
      ok - A proper error message is displayed
      - The cache is stopped
      - The cache exported object dissappeared

Steps to Reproduce

  1. On 2 DUTs (main and backup) prepare cache devices with the same size and devices for cache DRBD metadata
  2. Start a standby cache instance on the backup DUT and verify that a cache exported object appeared in the system
  3. Create a model/replicable configuration for the cache exported object and the cache device on the main DUT using external DRBD metadata
  4. Start configured DRBD and set the cache device on the main DUT as a primary device
  5. Start a cache instance on the DRBD device on the main DUT using different cache id than for the standby cache instance
  6. Stop the active cache instance
  7. Make sure that DRBD underlying devices are in sync
  8. Stop DRBD and detach standby cache
  9. Try activating the standby cache

Logs

[root@ ~]# casadm --standby --activate -d `dev nvme3n1p1` -i 2
Cache ID does not exist
[root@ ~]# casadm -L
No caches running
[root@ ~]# ls /dev/cas*
/dev/cas_ctrl

Context

mmichal10 commented 2 years ago

Although cache instance is stopped in this scenario, not all threads are stopped:

[root@localhost ~]# casadm --standby --activate -i 2 -d <path_by_id> 
Cache id specified by user and loaded from metadata are different
[root@localhost ~]# casadm -L
No caches running
[root@localhost ~]# ps aux | grep cas 
root        8548  0.9  0.0      0     0 ?        S    00:10   0:00 [cas_mngt_2]
root        8584  0.0  0.0   9208  1152 pts/0    S+   00:11   0:00 grep --color=auto cas