]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd/migration/HttpClient: avoid hitting an assert in advance_state()
authorIlya Dryomov <idryomov@gmail.com>
Wed, 11 Dec 2024 15:25:13 +0000 (16:25 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 16 Dec 2024 08:51:32 +0000 (09:51 +0100)
commit1fd1bd600f446a307028d024a32c855695ece3a5
treeefa328fc14f3b588871df2f8385074cc45486889
parent2c485039deba81ecb231b2685411f7a475dab4fe
librbd/migration/HttpClient: avoid hitting an assert in advance_state()

If the shutdown gets delayed until the state transition from
STATE_RESET_CONNECTING completes and the reconnect is successful
(i.e. next_state is STATE_READY), we eventually hit "unexpected
state transition" assert in advance_state().  The reason is that
advance_state() would update m_state and call disconnect() under
STATE_READY instead of STATE_SHUTTING_DOWN.  After the disconnect
maybe_finalize_shutdown() would enter advance_state() again with
STATE_SHUTDOWN as next_state, but the transition to that from
STATE_READY is invalid.

Plug this by not transitioning to next_state if current_state is
STATE_SHUTTING_DOWN.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 1046d610e3d6852258e6c4bf0355d0d13fb197b4)
src/librbd/migration/HttpClient.cc