Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal unindexed searches in syncrepl #4443

Closed
abbra opened this issue Nov 16, 2020 · 8 comments
Closed

Internal unindexed searches in syncrepl #4443

abbra opened this issue Nov 16, 2020 · 8 comments
Assignees
Labels
In JIRA ticket is in JIRA priority_high need urgent fix / highly valuable / easy to fix
Milestone

Comments

@abbra
Copy link

abbra commented Nov 16, 2020

On latest Fedora Rawhide test composes I see plenty of complains about partial unindexed searches from syncrepl plugin even though there are indexes defined for the attributes specified in the filter:

Logs for the compose test: https://openqa.fedoraproject.org/tests/722674#downloads

Typical errors in the log:

[15/Nov/2020:18:58:04.118737200 -0500] - ERR - log_result - Internal unindexed search: source (cn=server,cn=plugins,cn=config) search base="cn=changelog" filter="(&(changenumber>=72)(targetuniqueid=cb0ce98a-279a11eb-b8b0c9d4-8de4b180))" etime=0.002251050 nentries=1  notes=U details="Partially Unindexed Filter"
[15/Nov/2020:18:58:04.136015700 -0500] - ERR - log_result - Internal unindexed search: source (cn=server,cn=plugins,cn=config) search base="cn=changelog" filter="(&(changenumber>=73)(targetuniqueid=cb0ce98a-279a11eb-b8b0c9d4-8de4b180))" etime=0.002381400 nentries=1  notes=U details="Partially Unindexed Filter"
[15/Nov/2020:18:58:04.167502775 -0500] - ERR - log_result - Internal unindexed search: source (cn=server,cn=plugins,cn=config) search base="cn=changelog" filter="(&(changenumber>=74)(targetuniqueid=cb0ce98a-279a11eb-b8b0c9d4-8de4b180))" etime=0.000606675 nentries=1  notes=U details="Partially Unindexed Filter"
[15/Nov/2020:18:58:04.187813900 -0500] - ERR - log_result - Internal unindexed search: source (cn=server,cn=plugins,cn=config) search base="cn=changelog" filter="(&(changenumber>=74)(targetuniqueid=cb0ce98a-279a11eb-b8b0c9d4-8de4b180))" etime=0.000362425 nentries=1  notes=U details="Partially Unindexed Filter"
[15/Nov/2020:18:58:04.225106850 -0500] - ERR - log_result - Internal unindexed search: source (cn=server,cn=plugins,cn=config) search base="cn=changelog" filter="(&(changenumber>=75)(targetuniqueid=cb0ce986-279a11eb-b8b0c9d4-8de4b180))" etime=0.001161925 nentries=1  notes=U details="Partially Unindexed Filter"
[15/Nov/2020:18:58:04.228923925 -0500] - ERR - log_result - Internal unindexed search: source (cn=server,cn=plugins,cn=config) search base="cn=changelog" filter="(&(changenumber>=75)(targetuniqueid=cb0ce986-279a11eb-b8b0c9d4-8de4b180))" etime=0.002395775 nentries=1  notes=U details="Partially Unindexed Filter"

If I'd look at the indexes for cn=changelog backend, the indexes for those two attributes are defined. Here is output from my local instance:

# dsconf IPA-TEST backend index list cn=changelog |egrep '(changenumber|targetuniqueid)'
dn: cn=changenumber,cn=index,cn=changelog,cn=ldbm database,cn=plugins,cn=config
cn: changenumber
dn: cn=targetuniqueid,cn=index,cn=changelog,cn=ldbm database,cn=plugins,cn=config
cn: targetuniqueid
@abbra abbra added the needs triage The issue will be triaged during scrum label Nov 16, 2020
@mreynolds389
Copy link
Contributor

Are they indexed for equality? "eq" Can you provide the index entries from dse.ldif please? As I recall IPA used to use an invalid format for the index types (I'm sure that's been corrected, but I'd like to confirm it).

Do you see the index files under /var/lib/dirsrv/slapd-INST/db/changelog/ ? If not, please "reindex" those indexes...

@abbra
Copy link
Author

abbra commented Nov 16, 2020

# dsconf IPA-TEST backend index list cn=changelog |egrep -A6 '(changenumber|targetuniqueid)'
dn: cn=changenumber,cn=index,cn=changelog,cn=ldbm database,cn=plugins,cn=config
cn: changenumber
nsIndexType: eq
nsMatchingRule: integerOrderingMatch
nsSystemIndex: false
objectClass: top
objectClass: nsIndex

--
dn: cn=targetuniqueid,cn=index,cn=changelog,cn=ldbm database,cn=plugins,cn=config
cn: targetuniqueid
nsIndexType: eq
nsSystemIndex: false
objectClass: top
objectClass: nsIndex

and

 ls -la /var/lib/dirsrv/slapd-IPA-TEST/db/changelog/
total 680
drwx------. 2 dirsrv dirsrv   4096 Nov 10 09:02 .
drwxrwx---. 5 dirsrv dirsrv   4096 Nov 15 15:31 ..
-rw-------. 1 dirsrv dirsrv  16384 Nov 10 09:02 aci.db
-rw-------. 1 dirsrv dirsrv  16384 Nov 15 15:36 ancestorid.db
-rw-------. 1 dirsrv dirsrv  16384 Nov 15 15:36 changenumber.db
-rw-------. 1 dirsrv dirsrv  16384 Nov 10 09:00 cn.db
-rw-------. 1 dirsrv dirsrv     51 Nov 15 15:31 DBVERSION
-rw-------. 1 dirsrv dirsrv  57344 Nov 15 15:36 entryrdn.db
-rw-------. 1 dirsrv dirsrv  16384 Nov 15 15:36 entryusn.db
-rw-------. 1 dirsrv dirsrv 434176 Nov 15 15:36 id2entry.db
-rw-------. 1 dirsrv dirsrv  16384 Nov 15 15:36 nsuniqueid.db
-rw-------. 1 dirsrv dirsrv  16384 Nov 15 15:36 numsubordinates.db
-rw-------. 1 dirsrv dirsrv  16384 Nov 15 15:36 objectclass.db
-rw-------. 1 dirsrv dirsrv  16384 Nov 15 15:36 parentid.db
-rw-------. 1 dirsrv dirsrv  16384 Nov 10 08:59 seeAlso.db
-rw-------. 1 dirsrv dirsrv  16384 Nov 15 15:36 targetuniqueid.db

@mreynolds389
Copy link
Contributor

mreynolds389 commented Nov 16, 2020

Does dbscan return anything?

dbscan -f /var/lib/dirsrv/slapd-IPA-TEST/db/changelog/changenumber.db
dbscan -f /var/lib/dirsrv/slapd-IPA-TEST/db/changelog/targetuniqueid.db

@abbra
Copy link
Author

abbra commented Nov 16, 2020

Yes, it does. The values, of course, are different to what is in the original report as this is different system but nevertheless, it is working FreeIPA deployment:

[root@master ~]# dbscan -f /var/lib/dirsrv/slapd-IPA-TEST/db/changelog/changenumber.db
=209                                    
[root@master ~]# dbscan -f /var/lib/dirsrv/slapd-IPA-TEST/db/changelog/targetuniqueid.db
=882eba01-233311eb-8af0f60b-00866b2b    

@mreynolds389
Copy link
Contributor

Yes, it does. The values, of course, are different to what is in the original report as this is different system but nevertheless, it is working FreeIPA deployment:

Thanks for checking! I'm assuming this system is also generating those error messages?

Anyway I was really hoping it was a config/timing issue :-) We'll look into this soon...

@Firstyear
Copy link
Contributor

@mreynolds389 It could be that there is an internal filter transform that is occuring that has an un-indexed filter component we aren't logging.

@mreynolds389 mreynolds389 added this to the 1.4.3 milestone Nov 19, 2020
@mreynolds389 mreynolds389 removed the needs triage The issue will be triaged during scrum label Nov 19, 2020
@tbordaz tbordaz added the priority_medium good value but complex/risky/not crucial label Mar 25, 2021
@tbordaz tbordaz added priority_high need urgent fix / highly valuable / easy to fix In JIRA ticket is in JIRA and removed priority_medium good value but complex/risky/not crucial labels Apr 19, 2021
@mreynolds389 mreynolds389 self-assigned this Jul 13, 2021
mreynolds389 added a commit to mreynolds389/389-ds-base that referenced this issue Jul 15, 2021
Bug Description:

When a non-system index is added to a backend it is
disabled until the database is initialized or reindexed.
So in the case of the retro changelog the changenumber index
is alway disabled by default since it is never initialized.
This leads to unexpected unindexed searches of the retro
changelog.

Fix Description:

If an index has "nsSystemIndex" set to "true" then enable it
immediately.

relates:  389ds#4443

Reviewed by: spichugi & tbordaz(Thanks!!)
mreynolds389 added a commit that referenced this issue Jul 15, 2021
Bug Description:

When a non-system index is added to a backend it is
disabled until the database is initialized or reindexed.
So in the case of the retro changelog the changenumber index
is alway disabled by default since it is never initialized.
This leads to unexpected unindexed searches of the retro
changelog.

Fix Description:

If an index has "nsSystemIndex" set to "true" then enable it
immediately.

relates:  #4443

Reviewed by: spichugi & tbordaz(Thanks!!)
mreynolds389 added a commit that referenced this issue Jul 15, 2021
Bug Description:

When a non-system index is added to a backend it is
disabled until the database is initialized or reindexed.
So in the case of the retro changelog the changenumber index
is alway disabled by default since it is never initialized.
This leads to unexpected unindexed searches of the retro
changelog.

Fix Description:

If an index has "nsSystemIndex" set to "true" then enable it
immediately.

relates:  #4443

Reviewed by: spichugi & tbordaz(Thanks!!)
mreynolds389 added a commit that referenced this issue Jul 15, 2021
Bug Description:

When a non-system index is added to a backend it is
disabled until the database is initialized or reindexed.
So in the case of the retro changelog the changenumber index
is alway disabled by default since it is never initialized.
This leads to unexpected unindexed searches of the retro
changelog.

Fix Description:

If an index has "nsSystemIndex" set to "true" then enable it
immediately.

relates:  #4443

Reviewed by: spichugi & tbordaz(Thanks!!)
@mreynolds389
Copy link
Contributor

c1926df..357c16c 389-ds-base-1.4.4 -> 389-ds-base-1.4.4

18271ba..e762f35 389-ds-base-1.4.3 -> 389-ds-base-1.4.3

@mreynolds389
Copy link
Contributor

mreynolds389 added a commit that referenced this issue Aug 12, 2021
Bug Description:

When a non-system index is added to a backend it is
disabled until the database is initialized or reindexed.
So in the case of the retro changelog the changenumber index
is alway disabled by default since it is never initialized.
This leads to unexpected unindexed searches of the retro
changelog.

Fix Description:

If an index has "nsSystemIndex" set to "true" then enable it
immediately.

relates:  #4443

Reviewed by: spichugi & tbordaz(Thanks!!)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
In JIRA ticket is in JIRA priority_high need urgent fix / highly valuable / easy to fix
Projects
None yet
Development

No branches or pull requests

4 participants