[Rt-devel] [PATCH] More ACL checks from cache

Ruslan Zakirov ruslan.zakirov at gmail.com
Thu Apr 20 17:23:10 EDT 2006


On 4/21/06, Jesse Vincent <jesse at bestpractical.com> wrote:
>
> On Fri, Apr 21, 2006 at 12:44:33AM +0400, Ruslan Zakirov wrote:
> > Hello.
> > Here is patch that cut number of the queries we run on the DB by using
> > cache more aggressivly.
>
> Any basic stats on how effective this is?  I think I'm most comfortable
When you have SuperUser right on the system you need only one request to the DB.
It works pretty simple. If you have right ShowTicket on the Queue then
we put into cache record 'your_id,ShowTicket,Queue-XXX'. Then when we
check the right on any ticket from the Queue its object is one of the
equivalence objects for ticket and we fetch this info from cache.
This trick doesn't work for role-checks because of inability to get
real object you have right on.

> starting with this in 3.7, since 3.6 is so close to going out the door.
Heh, I don't mind if this prove concept and usefulness then I'm happy
to apply to any branch.

>
> I know it's pedantic, but can this get turned into something that reads
> a little easier to someone poking at the code?
This is one the most commented code, but anyway took several tries to
understand whole piture.

>
> (also $big_hashkey doesn't tell me what it's for, just that it's large
> ;)
bundle_hashkey? I don't know how to call it, it's really big hashkey
that contains references to all equiv objects.

>
>
> > +    $_ACL_CACHE->set( $big_hashkey => $hitcount? 1:-1 );
>
> > It's against 3.4.5
> >
> > --
> > Best regards, Ruslan.
>
[snip]
--
Best regards, Ruslan.


More information about the Rt-devel mailing list