gostor / gotgt

Simple Golang iSCSI Target framework
Apache License 2.0
261 stars 49 forks source link

Continuous relogins while running dd commands on exposed iSCSI LUNs #26

Closed payes closed 7 years ago

payes commented 7 years ago

I am testing the gotgt to use in another project that add scale-out/replication support for block volumes. When I exposed a volume and did "dd" test, I kept seeing continuous re-logins in the gotgt logs.

Steps to Reproduce:

Snippet of the logs

I1123 14:49:24.641125   12808 iscsid.go:189] rx handler: IOSTATE_RX_BHS
I1123 14:49:24.641164   12808 iscsid.go:250] got command:
Op: SCSI Data-Out (write)
Final = true
Immediate = false 
Data Segment Length = 8192
Task Tag = 63000000
AHS Length = 0
LUN = [0 0 0 0 0 0 0 0]
ExpectedDataLen = 0
CmdSN = 0
ExpStatSN = 84
Read = false 
Write = false 
CDB = 
I1123 14:49:24.641622   12808 common.go:207] io done *^@^@^@^T^@^@
^@^@^@^@^@^@^@^@
I1123 14:49:24.641878   12808 iscsid.go:588] 12
I1123 14:49:24.641905   12808 iscsid.go:189] rx handler: IOSTATE_RX_BHS
E1123 14:49:24.642398   12808 iscsid.go:779] unexpected cmd serial number: (97, 109)
I1123 14:49:37.165039   12808 iscsid.go:144] 127.0.0.1:3260
I1123 14:49:37.165098   12808 iscsid.go:145] Accepting ...
I1123 14:49:37.165146   12808 iscsid.go:150] connection is connected from 127.0.0.1:53032...
I1123 14:49:37.165178   12808 iscsid.go:138] Listening ...
I1123 14:49:37.165263   12808 iscsid.go:189] rx handler: IOSTATE_RX_BHS
I1123 14:49:37.415663   12808 iscsid.go:250] got command: 
Op: Login Request
Final = true
Immediate = true
Data Segment Length = 473 
Task Tag = 0
AHS Length = 0
ISID = 23d050000
Transit = true
Continue = false 
Current Stage = Login Operational Negotiation
Next Stage = Full Feature Phase 
I1123 14:49:37.415732   12808 iscsid.go:268] OpLoginReq
I1123 14:49:37.416104   12808 iscsid.go:572] CONN_STATE_KERNEL
I1123 14:49:37.416164   12808 iscsid.go:588] 12
I1123 14:49:37.416205   12808 iscsid.go:189] rx handler: IOSTATE_RX_BHS

Is anyone else also facing the same issue?

carmark commented 7 years ago

Hello @payes

This project is under heavy development, this should be a regression, we will try to figure out and provide the feedback ASAP.

Thanks,

payes commented 7 years ago

Hi @carmark

Thanks for getting back and also for all the efforts in getting the gotgt developed. I had a chance to dig a little more into this issue as part of my other project where I am using gotgt extensively. The issue is caused by ExpCmdSN, being incremented for SCSIOut packets. Can you please review the pull request I have generated.

Thanks

carmark commented 7 years ago

merged your PR, thanks.