Bug 918695

Summary: db2index with -tattrname:type,type fails
Product: Red Hat Enterprise Linux 7 Reporter: Nathan Kinder <nkinder>
Component: 389-ds-baseAssignee: Rich Megginson <rmeggins>
Status: CLOSED CURRENTRELEASE QA Contact: Sankar Ramalingam <sramling>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 7.0CC: amsharma, jgalipea, nhosoi
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-base-1.3.1.2-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 09:28:30 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:

Description Nathan Kinder 2013-03-06 18:14:07 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/389/ticket/453

Run db2index and specify the types of indexes to create e.g.
db2index or db2index.pl -tattr:eq,sub
will not create the eq and sub indexes

db2index_add_indexed_attr should convert the comma delimited list of index types into multiple values for the nsIndexType attribute

Comment 1 Rich Megginson 2013-10-01 23:25:06 UTC
moving all ON_QA bugs to MODIFIED in order to add them to the errata (can't add bugs in the ON_QA state to an errata).  When the errata is created, the bugs should be automatically moved back to ON_QA.

Comment 3 Amita Sharma 2014-01-06 10:03:14 UTC
Hi Noriko,

I tried testing this with ::
[root@dhcp201-149 basic]# rpm -qa | grep 389
389-adminutil-1.1.15-3.fc19.1.x86_64
389-admin-1.1.31-1.fc19.2.x86_64
389-admin-console-doc-1.1.8-5.fc19.noarch
389-console-1.1.7-4.fc19.noarch
389-ds-base-1.3.1.6-12.el7.x86_64
389-admin-console-1.1.8-5.fc19.noarch
389-ds-console-doc-1.2.7-2.fc19.noarch
389-dsgw-1.1.10-1.fc19.x86_64
389-ds-base-libs-1.3.1.6-12.el7.x86_64
389-ds-console-1.2.7-2.fc19.noarch
389-ds-1.2.2-4.fc19.noarch

Test Case 1:: GOOD
===================
[root@dhcp201-149 ~]# db2index -n userRoot -t cn:eq,sub
[06/Jan/2014:14:26:58 +051800] - WARNING: Import is running with nsslapd-db-private-import-mem on; No other process is allowed to access the database
[06/Jan/2014:14:26:58 +051800] - check_and_set_import_cache: pagesize: 4096, pages: 479602, procpages: 53190
[06/Jan/2014:14:26:58 +051800] - Import allocates 767360KB import cache.
[06/Jan/2014:14:26:58 +051800] - userRoot: Indexing attribute: cn
[06/Jan/2014:14:26:58 +051800] - userRoot: Finished indexing.
[06/Jan/2014:14:26:58 +051800] - All database threads now stopped
[root@dhcp201-149 ~]# systemctl start dirsrv@dhcp201-149
[root@dhcp201-149 ~]# 

[root@dhcp201-149 ~]# db2index.pl -v -D "cn=Directory Manager" -w Secret123 -n userRoot -t sn:eq,sub
ldap_initialize( ldap://dhcp201-149.englab.pnq.redhat.com:389 )
Successfully added task entry "cn=db2index_2014_1_6_14_36_5, cn=index, cn=tasks, cn=config"

Test Case 2:: Difference in results for same thing
=====================================================
 [root@dhcp201-149 ~]# db2index -n userRoot -t cn:eq sub
[06/Jan/2014:15:00:28 +051800] - WARNING: Import is running with nsslapd-db-private-import-mem on; No other process is allowed to access the database
[06/Jan/2014:15:00:28 +051800] - check_and_set_import_cache: pagesize: 4096, pages: 479602, procpages: 53190
[06/Jan/2014:15:00:28 +051800] - Import allocates 767360KB import cache.
[06/Jan/2014:15:00:28 +051800] - userRoot: Indexing attribute: cn
[06/Jan/2014:15:00:28 +051800] - userRoot: Finished indexing.
[06/Jan/2014:15:00:28 +051800] - All database threads now stopped

[root@dhcp201-149 ~]# db2index.pl -v -D "cn=Directory Manager" -w Secret123 -n userRoot -t mail:eq sub
Usage: db2index.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } [-P protocol]
                   -n backendname [-t attributeName[:indextypes[:matchingrules]]] [-T vlvTag] [-v] [-h]

Test Case 3 :: Difference in results for same thing
=====================================================
[root@dhcp201-149 ~]# db2index -n userRoot -t givenname:eq, sub
[06/Jan/2014:15:05:35 +051800] - WARNING: Import is running with nsslapd-db-private-import-mem on; No other process is allowed to access the database
[06/Jan/2014:15:05:35 +051800] - check_and_set_import_cache: pagesize: 4096, pages: 479602, procpages: 53189
[06/Jan/2014:15:05:35 +051800] - Import allocates 767360KB import cache.
[06/Jan/2014:15:05:35 +051800] - userRoot: Indexing attribute: givenname
[06/Jan/2014:15:05:35 +051800] - userRoot: Finished indexing.
[06/Jan/2014:15:05:35 +051800] - All database threads now stopped

[root@dhcp201-149 ~]# db2index.pl -v -D "cn=Directory Manager" -w Secret123 -n userRoot -t mail:eq, sub
Usage: db2index.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } [-P protocol]
                   -n backendname [-t attributeName[:indextypes[:matchingrules]]] [-T vlvTag] [-v] [-h]

Conclusion ::  -t attribute:type, type AND -t attribute:type type works for db2index but not for db2index.pl
Questions ::
a. Which one is executing correctly , db2index or db2index.pl?
b. Should be logged as another bug or reopen this one?

Thanks,
Ami

Comment 4 Rich Megginson 2014-01-06 15:35:27 UTC
The problem with test case 2 and 3 is that db2index is not working, but it is not giving an error.  If you check, you will see that db2index -n userRoot -t cn:eq sub is not creating a substring index for cn.  Also, db2index -n userRoot -t givenname:eq, sub is not creating a substring index for givenname.

This is a new bug - better input argument validation and error messages for db2index and db2index.pl.

Comment 5 Amita Sharma 2014-01-07 07:56:39 UTC
Based on comment https://bugzilla.redhat.com/show_bug.cgi?id=918695#c4, Marking this bug as VERIFIED and opened  New Bug :: https://bugzilla.redhat.com/show_bug.cgi?id=1049190

Comment 6 Ludek Smid 2014-06-13 09:28:30 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.