iscsi target removed without initiator logging out
symptom :
"detected conn error" error message from kernel
"conn 0 login rejected" error messages from iscsid
investigation:
From implementation point of view, the kernel iscsi driver noticed the loss of connection by means of a transport checking timer function - iscsi_check_transport_timeouts. It then sent out the event to iscsid through the ISCSI_NL_GRP_ISCSID multicast group. iscsid received the event and tried to reopen the connection. But the session reopen failed because of the login failure and iscsid kept trying to reopen the session until the deletion of the iscsi session.
Kernel code path:
1. setup an iscsi connection
iscsi_sw_tcp_conn_create -> iscsi_tcp_conn_setup -> iscsi_conn_setup : sets up a transport_timer (iscsi_check_transport_timeouts)
2. ping to target timeout and send an event to iscsid
iscsi_check_transport_timeouts -> iscsi_conn_failure -> iscsi_conn_error_event -> iscsi_multicast_skb
Userspace code path:
1. receives the connection error event from kernel and tries to recover it the first time
krecv_pdu_begin -> ctldev_handle -> iscsi_sched_ev_context (async)-> session_conn_error -> __conn_error_handle -> session_conn_reopen
2. session connection reopen will eventually sent out login request to target portal group
session_conn_reopen -> iscsi_conn_connect (async)-> session_conn_poll -> iscsi_login_req
3. login response is received and the error is printed according to the status detail, then the error handling logic tries to reopen the session again, which causes the endless login retry, thus the error message.
iscsi_sched_ev_context (async)-> session_conn_recv_pdu -> iscsi_recv_login_rsp -> __check_iscsi_status_class: prints the error message
-> iscsi_login_eh -> session_conn_reopen
Spec:
ttps://tools.ietf.org/html/rfc7143#section-7.1.4.3 specifies. If the failed connection was the last or only connection in the session, a new connection establishment is mandatory.
本文探讨了iSCSI连接丢失后的系统行为,包括内核与用户空间的处理流程。当检测到连接失败时,iSCSI驱动会发送事件通知给iscsid服务尝试重新建立连接。若登录失败,则会出现无限重试的情况。
1303

被折叠的 条评论
为什么被折叠?



