]> git-server-git.apps.pok.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)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Fri, 21 Nov 2025 12:16:01 +0000 (19:16 +0700)
commitbcbed3092b72f6e4d6f6b207b4c78c30ceb48ee4
tree7f6ccd1d7867368b916f7bf1dcc835ce3419e902
parent55ba2be7efe154aa9cf6f25f15a231cf4921f60b
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>
(cherry picked from commit 057c5b1610c11ad8cc6d0cde43bee1306228275b)
src/mds/Migrator.cc