#1202 Simple Paged Search control needs to be used more sparingly
Closed: Fixed None Opened 8 years ago by sgallagh.

We added support for the Simple Paged Search in ticket #658 and SSSD 1.5.8. When we did so, we chose to default to always requesting paged searches for all requests. However, it turns out that RFC 2696 does not mandate that the LDAP server supports more than one paging search at a time on the same connection. Some LDAP servers (notably 389 DS 1.2.9 and older) allow only a single paged search to be in progress on a request at one time. This results in receiving an error from LDAP that the server refuses to perform the operation. Once ticket #1201 is fixed, this will result in offline operation (right now it's misbehaving as if it received zero results). We need to avoid both of these events.

RFC 2696 does specify that if the result size being returned is smaller than the requested page size that the paging control should be ignored. This would mitigate the problem, but it appears that 389 DS also chooses to not ignore the control in this case.

In general, we need to find ways to minimize our usage of the paging control where available. I propose the following changes:

  1. Add a boolean option to {{{ldap_generic_search_send()}}} to specify whether to use the paging control (when available).
  2. Do not request the paging control when we expect a single-valued return from the request.
  3. Always request the paging control for enumeration requests.
  4. Serialize paging requests by maintaining a queue of lookups requiring paging and allow only one to operate at a time.{{{[1]}}}
  5. If it can be reasonably determined that replies will never exceed 500 entries, also omit the paging control{{{[2]}}}

{{{[1]}}}: This will likely introduce apparent performance issues when performing initgroups() requests, since they will no longer be able to run in parallel. We must always assume that the user may belong to many groups.

{{{[2]}}}: I'm not 100% sure about this one. It's possible for a server to manually set its page size smaller than 500, though I doubt very many would do so. On the other hand, I can't come up with any ideas offhand for lookups of greater than a single entry that could not therefore result in a potentially-infinite set of results. So this may be a moot point.

Fields changed

status: new => assigned
version: 1.8.0 beta 2 => 1.8.0 beta 3

Fields changed

milestone: NEEDS_TRIAGE => SSSD 1.8.0 (LTM)

Fields changed

blocking: => 1207

I have split this into two tickets. The mitigation pieces (1 and 2 above) will be resolved by this ticket. The more complete portion will be resolved in Ticket #1207

patch: 0 => 1

Fixed by:
- 2f3ee3f (master)
- 3828873 (sssd-1-8)

resolution: => fixed
status: assigned => closed

Metadata Update from @sgallagh:
- Issue assigned to sgallagh
- Issue marked as blocked by: #1207
- Issue set to the milestone: SSSD 1.8.0 (LTM)

2 years ago

Login to comment on this ticket.