@@ -230,3 +230,46 @@ def test_session_evict_blocklisted(self):
230230
231231 self .mount_a .kill_cleanup ()
232232 self .mount_a .mount_wait ()
233+
234+ def test_session_evict_non_blocklisted (self ):
235+ """
236+ Check that mds evicts without blocklisting client
237+ """
238+
239+ self .config_set ('mds' , 'mds_session_blocklist_on_evict' , False )
240+ self .fs .set_max_mds (2 )
241+ status = self .fs .wait_for_daemons ()
242+
243+ self .fs .set_ceph_conf ('client' , 'client reconnect stale' , True )
244+ self .mount_a .remount ()
245+ self .mount_b .remount ()
246+
247+ self .mount_a .run_shell_payload ("mkdir {d0,d1} && touch {d0,d1}/file" )
248+ self .mount_a .setfattr ("d0" , "ceph.dir.pin" , "0" )
249+ self .mount_a .setfattr ("d1" , "ceph.dir.pin" , "1" )
250+ self ._wait_subtrees ([('/d0' , 0 ), ('/d1' , 1 )], status = status )
251+
252+ self .mount_a .run_shell (["touch" , "d0/f0" ])
253+ self .mount_a .run_shell (["touch" , "d1/f0" ])
254+ self .mount_b .run_shell (["touch" , "d0/f1" ])
255+ self .mount_b .run_shell (["touch" , "d1/f1" ])
256+
257+ self .assert_session_count (2 , mds_id = self .fs .get_rank (rank = 0 , status = status )['name' ])
258+ self .assert_session_count (2 , mds_id = self .fs .get_rank (rank = 1 , status = status )['name' ])
259+
260+ mount_a_client_id = self .mount_a .get_global_id ()
261+ self .fs .mds_asok (['session' , 'evict' , "%s" % mount_a_client_id ],
262+ mds_id = self .fs .get_rank (rank = 0 , status = status )['name' ])
263+
264+ self .mount_a .run_shell (["touch" , "d0/f00" ])
265+ self .mount_a .run_shell (["touch" , "d1/f00" ])
266+ self .mount_b .run_shell (["touch" , "d0/f10" ])
267+ self .mount_b .run_shell (["touch" , "d1/f10" ])
268+
269+ # 10 seconds should be enough for reconnecting the sessions
270+ time .sleep (10 )
271+ self .assert_session_count (2 , mds_id = self .fs .get_rank (rank = 0 , status = status )['name' ])
272+ self .assert_session_count (2 , mds_id = self .fs .get_rank (rank = 1 , status = status )['name' ])
273+
274+ self .mount_a .kill_cleanup ()
275+ self .mount_a .mount_wait ()
0 commit comments