Project

General

Profile

Backport #17895

Updated by Nathan Cutler over 7 years ago

RBD extent objects can't be manually evicted from a cache tier when snapshots exist: 

 > ./rados -p rbd-cache cache-flush-evict-all 
         rbd_data.10142ae8944a.00000000000000fc   
 failed to evict /rbd_data.10142ae8944a.00000000000000fc: (16) Device or resource busy 
 ... 
 > ./rados -p rbd-cache listwatchers rbd_data.10142ae8944a.00000000000000fc 
 > echo $? 
 0 

 This object is present in both the hot and cold tier: 
 > ./ceph osd map rbd-cache rbd_data.10142ae8944a.00000000000000fc 
 osdmap e18 pool 'rbd-cache' (3) object 'rbd_data.10142ae8944a.00000000000000fc' -> pg 3.76b49b48 (3.0) -> up ([1,2,0], p1) acting ([1,2,0], p1) 
 > find dev/osd1/current/3.0_head/ | grep 10142ae8944a.00000000000000fc 
 dev/osd1/current/3.0_head/rbd\udata.10142ae8944a.00000000000000fc__head_76B49B48__3 
 dev/osd1/current/3.0_head/rbd\udata.10142ae8944a.00000000000000fc__5_76B49B48__3 

 > ./ceph osd map rbd rbd_data.10142ae8944a.00000000000000fc 
 osdmap e18 pool 'rbd' (0) object 'rbd_data.10142ae8944a.00000000000000fc' -> pg 0.76b49b48 (0.0) -> up ([0,2,1], p0) acting ([0,2,1], p0) 
 > find dev/osd0/current/0.0_head/ | grep 10142ae8944a.00000000000000fc 
 dev/osd0/current/0.0_head/rbd\udata.10142ae8944a.00000000000000fc__5_76B49B48__0 
 dev/osd0/current/0.0_head/rbd\udata.10142ae8944a.00000000000000fc__head_76B49B48__0 

 The evict request targets the head (non-snapshot) object, and in attempting to evict, _verify_no_head_clones() detects the presence of the snapshot (clone) object, and rejects eviction as a result. 

 This bug is addressed by the following upstream changes: 

 commit 383177be07700f9fee067ecb7a27155c322f98dd 
 Author: Mingxin Liu <mingxin@xsky.com> 
 Date:     Mon Jun 27 14:37:30 2016 +0800 

     qa/workunits: update test_cache_pool.sh 
    
     Signed-off-by: Mingxin Liu <mingxin@xsky.com> 

 commit 3dd9fa2fb39c76ba3977d7bc09cd28bb3465d56c 
 Author: Mingxin Liu <mingxin@xsky.com> 
 Date:     Mon Jun 27 14:35:45 2016 +0800 

     tools/rados: add --with-clones option to include clones for cache-flush/cache-evict 
    
     Signed-off-by: Mingxin Liu <mingxin@xsky.com> 

 commit b1cf2d9276834d04172d45d5f4dd48ca3e99d338 
 Author: Mingxin Liu <mingxin@xsky.com> 
 Date:     Sat Jun 25 11:19:01 2016 +0800 

     tools/rados: default to include clone objects when excuting "cache-flush-evict-all" 
    
     Signed-off-by: Mingxin Liu <mingxin@xsky.com> 

 Github SR to follow.

Back