Edgewall Software

Ticket #4245 (reopened defect)

Opened 23 months ago

Last modified 15 months ago

[PATCH] Tickets are slow with large amount of users and permissions

Reported by: ants.aasma@… Owned by: cmlenz
Priority: normal Milestone: 0.11.3
Component: general Version: devel
Severity: normal Keywords: slow
Cc:

Description

TicketSystem?.get_ticket_fields() implements an exremely inefficient algorithm to find users that have a certain permission (O(n2users * perms_per_useravg)). I have added a more efficient function to PermissionSystem? that enables querying users having a specified permission directly. It correctly resolves group memberships and hierarchical permissions.

Attachments

trac.get_users_with_permission.trunk.patch (4.3 kB) - added by ants.aasma@… 23 months ago.
Patch
trac.get_users_with_permission.v2.patch (4.0 kB) - added by ants.aasma@… 21 months ago.
Second version of the patch. Using the env.get_known_users() interface to get users.
get_users_with_permission.groupprovider_fix.patch (2.5 kB) - added by ants.aasma@… 15 months ago.
Adds support for the implicit group providers
groupprovider_fix.diff_against_prev_impl.patch (1.4 kB) - added by ants.aasma@… 15 months ago.
Diff against the previous implementation to highlight the changes.

Change History

Changed 23 months ago by ants.aasma@…

Patch

Changed 23 months ago by cmlenz

  • owner changed from jonas to cmlenz
  • milestone set to 0.11

I'll look into this tomorrow. Candidate for being backported to 0.10-stable.

Changed 21 months ago by ants.aasma@…

Second version of the patch. Using the env.get_known_users() interface to get users.

Changed 21 months ago by cmlenz

  • status changed from new to closed
  • resolution set to fixed

Slightly modified patch applied in [4625].

Changed 15 months ago by ecarter

  • status changed from closed to reopened
  • resolution fixed deleted
  • milestone changed from 0.11 to 0.11.1

This change did not account for the magic 'authenticated' group, causing the regression reported in #4630. See [5849]. We went back to a very inefficient solution, so we need to improve that.

Changed 15 months ago by ants.aasma@…

Adds support for the implicit group providers

Changed 15 months ago by ants.aasma@…

Diff against the previous implementation to highlight the changes.

Changed 15 months ago by ants.aasma@…

Attached a fix that accounts for the group providers. This would be a lot more efficient, if the group providers had an get_group_members method.

This isn't tested, because I don't have a test enviroment set up nor the time to do so. But I figured I'd get the code out there if anyone has.

Changed 15 months ago by ants.aasma@…

Already spotted an oops, line 168 in new should read:

                        implicit_groups[groupname] = set([username])

(missing list brackets from set construction)

Add/Change #4245 ([PATCH] Tickets are slow with large amount of users and permissions)

Author



Change Properties
<Author field>
Action
as reopened
as The resolution will be set. Next status will be 'closed'
to The owner will change from cmlenz. Next status will be 'new'
 
Note: See TracTickets for help on using tickets.