]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mds: session in the importing state cannot be cleared if an export subtree task is...
authorZhansong Gao <zhsgao@hotmail.com>
Fri, 26 May 2023 04:20:17 +0000 (12:20 +0800)
committerZhansong Gao <zhsgao@hotmail.com>
Wed, 13 Nov 2024 09:09:42 +0000 (17:09 +0800)
commit057c5b1610c11ad8cc6d0cde43bee1306228275b
treedc9a3c0cc14cb01810ac91b3423aed29cb757a1b
parenteccaf85294ae80bb76b75f30d74957c6bf03745b
mds: session in the importing state cannot be cleared if an export subtree task is interrupted while the state of importer is acking

The related sessions in the importer are in the importing state(`Session::is_importing` return true) when the state of importer is `acking`,
`Migrator::import_reverse` called by `MDCache::handle_resolve` should reverse the process to clear the importing state if the exporter restarts
at this time, but it doesn't do that actually because of its bug. And it will cause these sessions to not be cleared when the client is
unmounted(evicted or timeout) until the mds is restarted.

The bug in `import_reverse` is that it contains the code to handle state `IMPORT_ACKING` but it will never be executed because
the state is modified to `IMPORT_ABORTING` at the beginning. Move `stat.state = IMPORT_ABORTING` to the end of import_reverse
so that it can handle the state `IMPORT_ACKING`.

Fixes: https://tracker.ceph.com/issues/61459
Signed-off-by: Zhansong Gao <zhsgao@hotmail.com>
src/mds/Migrator.cc