Issue 8226 - long searches are bad for back-mdb
Summary: long searches are bad for back-mdb
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-27 12:54 UTC by Howard Chu
Modified: 2021-10-28 21:21 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Howard Chu 2015-08-27 12:54:36 UTC
Full_Name: Howard Chu
Version: 2.4
OS: 
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (70.87.222.79)
Submitted by: hyc


Long-lived read transactions prevent old pages from being reused in LMDB. We've
seen a situation triggered by the syncprov overlay that aggravates this problem
- a consumer connects and performs a syncrepl refresh. Its sync cookie is too
old for the syncprov sessionlog to be used, so syncprov must generate a
presentlist of all of the entryUUIDs in the database. This is a very long search
(in this case, around 1.5 million objects) and writes are continuing while this
happens. Also, there are multiple consumers repeating this at staggered times
(due to the situation described in ITS#8225 they all tend to reconnect at
closely situated times).

Because of these long read transactions the incoming writes are forced to use
new database pages, and so the DB file size grows drastically during these
refreshes.

This specific case for syncprov can be mitigated by using a much larger syncprov
sessionlog (and in the future, by enhancing syncprov to use accesslog), but
there are many other instances when clients may legitimately issue searches that
span the entire database. The fix from ITS#7904 should be extended to release
and reacquire the read transaction every N entries to make large searches
friendlier to write traffic.

The default value of N probably should not be zero, but could be a value (e.g.
1000, with a default sizelimit of 500) that won't affect the majority of normal
search requests.
Comment 1 Howard Chu 2015-08-30 03:55:54 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Bugs
Comment 2 Quanah Gibson-Mount 2016-01-29 22:25:51 UTC
changed notes
changed state Test to Release
Comment 3 Quanah Gibson-Mount 2016-02-11 00:51:12 UTC
changed notes
changed state Release to Closed
Comment 4 OpenLDAP project 2017-10-11 19:13:57 UTC
fixed in master
fixed in RE25
fixed in RE24 (2.4.44)
Optimization added (2.4.46)
Comment 5 Quanah Gibson-Mount 2017-10-11 19:13:57 UTC
changed notes