* [iscsiadm] iscsiadm creates multiple same sessions when run with --login option in parallel.
@ 2017-09-28 6:42 ` Tangchen (UVP)
0 siblings, 0 replies; 2+ messages in thread
From: Tangchen (UVP) @ 2017-09-28 6:42 UTC (permalink / raw)
To: open-iscsi
Cc: linux-kernel, linux-scsi, Zhangyanfei (YF), guijianfeng, Tangchen (UVP)
Hi guys,
If we run iscsiadm -m node --login command through the same IP address 4 times, only one session will be created.
But if we run them in parallel, then 4 same sessions could be created.
( Here, xxx.xxx.xxx.xxx is the IP address to the IPSAN. I'm using the same IP in these 4 commands. )
# iscsiadm -m node -p xxx.xxx.xxx.xxx --login &
# iscsiadm -m node -p xxx.xxx.xxx.xxx --login &
# iscsiadm -m node -p xxx.xxx.xxx.xxx --login &
# iscsiadm -m node -p xxx.xxx.xxx.xxx --login &
Logging in to [iface: default, target: iqn. xxx.xxx.xxx.xxx, portal: xxx.xxx.xxx.xxx] (multiple)
Logging in to [iface: default, target: iqn. xxx.xxx.xxx.xxx, portal: xxx.xxx.xxx.xxx] (multiple)
Logging in to [iface: default, target: iqn. xxx.xxx.xxx.xxx, portal: xxx.xxx.xxx.xxx] (multiple)
Logging in to [iface: default, target: iqn. xxx.xxx.xxx.xxx, portal: xxx.xxx.xxx.xxx] (multiple)
Login to [iface: default, target: xxx.xxx.xxx.xxx, portal: xxx.xxx.xxx.xxx] successful.
Login to [iface: default, target: xxx.xxx.xxx.xxx, portal: xxx.xxx.xxx.xxx] successful.
Login to [iface: default, target: xxx.xxx.xxx.xxx, portal: xxx.xxx.xxx.xxx] successful.
Login to [iface: default, target: xxx.xxx.xxx.xxx, portal: xxx.xxx.xxx.xxx] successful.
# iscsiadm -m session
tcp: [1] xxx.xxx.xxx.xxx (non-flash)
tcp: [2] xxx.xxx.xxx.xxx (non-flash)
tcp: [3] xxx.xxx.xxx.xxx (non-flash)
tcp: [4] xxx.xxx.xxx.xxx (non-flash)
If we check the net connection in /proc/net/nf_conntrack, they are 4 TCP connections with different src ports.
And if we run logout command only once, all the 4 sessions will be destroyed.
Unfortunately, service like multipathd cannot tell the difference between them. If we have 4 same sessions,
4 paths will be created connecting to the dm device. But actually they are the same paths.
Referring to the code, iscsiadm command does prevent creating same session by checking /sys/class/iscsi_session/ dir.
But no multi-thread protection in there.
Any idea how to solve this problem ?
Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [iscsiadm] iscsiadm creates multiple same sessions when run with --login option in parallel.
@ 2017-09-28 6:42 ` Tangchen (UVP)
0 siblings, 0 replies; 2+ messages in thread
From: Tangchen (UVP) @ 2017-09-28 6:42 UTC (permalink / raw)
To: open-iscsi-/JYPxA39Uh5TLH3MbocFFw
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-scsi-u79uwXL29TY76Z2rM5mHXA, Zhangyanfei (YF),
guijianfeng, Tangchen (UVP)
Hi guys,
If we run iscsiadm -m node --login command through the same IP address 4 times, only one session will be created.
But if we run them in parallel, then 4 same sessions could be created.
( Here, xxx.xxx.xxx.xxx is the IP address to the IPSAN. I'm using the same IP in these 4 commands. )
# iscsiadm -m node -p xxx.xxx.xxx.xxx --login &
# iscsiadm -m node -p xxx.xxx.xxx.xxx --login &
# iscsiadm -m node -p xxx.xxx.xxx.xxx --login &
# iscsiadm -m node -p xxx.xxx.xxx.xxx --login &
Logging in to [iface: default, target: iqn. xxx.xxx.xxx.xxx, portal: xxx.xxx.xxx.xxx] (multiple)
Logging in to [iface: default, target: iqn. xxx.xxx.xxx.xxx, portal: xxx.xxx.xxx.xxx] (multiple)
Logging in to [iface: default, target: iqn. xxx.xxx.xxx.xxx, portal: xxx.xxx.xxx.xxx] (multiple)
Logging in to [iface: default, target: iqn. xxx.xxx.xxx.xxx, portal: xxx.xxx.xxx.xxx] (multiple)
Login to [iface: default, target: xxx.xxx.xxx.xxx, portal: xxx.xxx.xxx.xxx] successful.
Login to [iface: default, target: xxx.xxx.xxx.xxx, portal: xxx.xxx.xxx.xxx] successful.
Login to [iface: default, target: xxx.xxx.xxx.xxx, portal: xxx.xxx.xxx.xxx] successful.
Login to [iface: default, target: xxx.xxx.xxx.xxx, portal: xxx.xxx.xxx.xxx] successful.
# iscsiadm -m session
tcp: [1] xxx.xxx.xxx.xxx (non-flash)
tcp: [2] xxx.xxx.xxx.xxx (non-flash)
tcp: [3] xxx.xxx.xxx.xxx (non-flash)
tcp: [4] xxx.xxx.xxx.xxx (non-flash)
If we check the net connection in /proc/net/nf_conntrack, they are 4 TCP connections with different src ports.
And if we run logout command only once, all the 4 sessions will be destroyed.
Unfortunately, service like multipathd cannot tell the difference between them. If we have 4 same sessions,
4 paths will be created connecting to the dm device. But actually they are the same paths.
Referring to the code, iscsiadm command does prevent creating same session by checking /sys/class/iscsi_session/ dir.
But no multi-thread protection in there.
Any idea how to solve this problem ?
Thanks.
--
You received this message because you are subscribed to the Google Groups "open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-iscsi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To post to this group, send email to open-iscsi-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-09-28 6:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-28 6:42 [iscsiadm] iscsiadm creates multiple same sessions when run with --login option in parallel Tangchen (UVP)
2017-09-28 6:42 ` Tangchen (UVP)
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.