Bug 736740

Summary: "tgt-admin --update" fails when adding many devices to the configuration file at once
Product: Red Hat Enterprise Linux 6 Reporter: Rami Vaknin <rvaknin>
Component: scsi-target-utilsAssignee: Andy Grover <agrover>
Status: CLOSED ERRATA QA Contact: Storage QE <storage-qe>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2CC: bdonahue, fge, hateya, mgoldboi, yeylon
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 18:58:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
fix none

Description Rami Vaknin 2011-09-08 15:04:52 UTC
Environment:
scsi-target-utils-1.0.14-2.el6.x86_64 on RHEL6.1

I updated the /etc/tgt/targets.conf with:
scenario a - 250 targets, each target contains one lun (lvs as backing store)
scenario b - 1 target with 250 luns (lvs as backing store)

Then I tried to restart tgtd or perform "tgt-admin --update ALL", the tgtd restart failed and the "tgt-admin --update ALL" fails every time with the same error message but each time on different target, it seems that each "tgt-admin --update ALL" can deal with only ~7-10 new target which it opens successfully and then it fails.

For the case of 250 targets - I need to run "tgt-admin --update ALL" ~30 times for all devices to be open.

[root@lion ~]# for i in `seq 1 10` ; do tgt-admin --update ALL ; done
tgtadm: this target already exists
Command:
	tgtadm -C 0 --lld iscsi --op new --mode target --tid 60 -T script121
exited with code: 22.
tgtadm: this target already exists
Command:
	tgtadm -C 0 --lld iscsi --op new --mode target --tid 74 -T script134
exited with code: 22.
tgtadm: this target already exists
Command:
	tgtadm -C 0 --lld iscsi --op new --mode target --tid 77 -T script137
exited with code: 22.
tgtadm: this target already exists
Command:
	tgtadm -C 0 --lld iscsi --op new --mode target --tid 78 -T script138
exited with code: 22.
tgtadm: this target already exists
Command:
	tgtadm -C 0 --lld iscsi --op new --mode target --tid 92 -T script150
exited with code: 22.
tgtadm: this target already exists
Command:
	tgtadm -C 0 --lld iscsi --op new --mode target --tid 93 -T script141
exited with code: 22.
tgtadm: this target already exists
Command:
	tgtadm -C 0 --lld iscsi --op new --mode target --tid 110 -T script167
exited with code: 22.
tgtadm: this target already exists
Command:
	tgtadm -C 0 --lld iscsi --op new --mode target --tid 111 -T script159
exited with code: 22.
tgtadm: this target already exists
Command:
	tgtadm -C 0 --lld iscsi --op new --mode target --tid 113 -T script17
exited with code: 22.
tgtadm: this target already exists
Command:
	tgtadm -C 0 --lld iscsi --op new --mode target --tid 114 -T script170
exited with code: 22.
[root@lion ~]#

Comment 2 Andy Grover 2011-09-30 22:41:43 UTC
just to be clear, both scenario A and B show the same issue, each run of update --ALL only handles 7-10 before failing?

Comment 3 Rami Vaknin 2011-10-02 09:09:21 UTC
Correct.

Comment 4 Andy Grover 2011-10-03 22:53:47 UTC
Created attachment 526151 [details]
fix

Can reproduce. This fixes it for me.

Comment 7 Rami Vaknin 2011-10-09 11:23:15 UTC
Not reproducible with the rpm from Comment 5.

Comment 9 Barry Donahue 2011-10-17 18:17:08 UTC
Verified in comment 7 and SanityOnly.

Comment 10 Andy Grover 2011-11-03 00:12:42 UTC
*** Bug 727801 has been marked as a duplicate of this bug. ***

Comment 11 errata-xmlrpc 2011-12-06 18:58:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1762.html