Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
CFQUERY cache key collisions
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  11 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jari Ketola  
View profile  
 More options Apr 11 2012, 6:40 am
From: Jari Ketola <ket...@gmail.com>
Date: Wed, 11 Apr 2012 03:40:21 -0700 (PDT)
Local: Wed, Apr 11 2012 6:40 am
Subject: CFQUERY cache key collisions

Hello,

Back in September I posted a message regarding query cache key collisions<https://groups.google.com/d/msg/openbd/0Nmzg-eW0u4/GXMNIBSmDAEJ>.
Back then I was unable to reproduce the problem so that it could be
debugged properly, but since we are seeing more and more of these
collisions, I decided to bite the bullet and try and track it down.

Having found a good, somewhat traceable error, I was able to locate two
queries that collide. Incidentally both are using the CACHENAME attribute,
and one is using CACHEDOMAIN as well.

Here are two queries that cause a cache collision:

<cfquery datasource="#ds#" name="query1"
cachedwithin="#createtimespan(0,0,1,0)#"
cachename="getFeaturesForSpecificProduct_3447_18_english"
cachedomain="hardwareHighPriority">
    select 1 as one
</cfquery>

<cfquery datasource="#ds#" name="query2"
cachedwithin="#createtimespan(0,0,1,0)#"
cachename="specificSoftware-428-5483 Ratings spanish">
    select 2 as two
</cfquery>

CFDUMPing the query results easily verifies the collision:

<cfdump var="#query1#">

query [long version] one11Query Source:SQL (CACHE REFRESH)Datasource:DS
Query:select 1 as oneTime:1 ms
<cfdump var="#query2#">

query [long version] one11Query Source:SQL (FROM CACHE)Datasource:DSQuery:select
2 as twoTime:0 ms
Having taken a look at the OpenBD code for (query) caching, I don't think
there's anything wrong with the cache keys themselves, or the cache domain.
Unfortunately that's as far as I'm able to track the problem down.

Can anyone replicate the problem with the queries above? It doesn't seem to
be hostname related, since the same exact cachenames collide on all our
servers.

I would like to emphasize that the problem occurs also on queries with no
CACHENAME set. Actually avoiding these cache collisions is the reason why
we started adding cache names in the first place.

OpenBD version:

builddate    2012-01-01 10:14:17 GMT
edition    8
level    GPL
releasedate    1 January 2012
state    final release
version    2.0.2

Thanks in advance!

 Jari


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nitai @ Razuna  
View profile  
 More options Apr 11 2012, 7:46 am
From: "Nitai @ Razuna" <ni...@razuna.com>
Date: Wed, 11 Apr 2012 13:46:50 +0200
Local: Wed, Apr 11 2012 7:46 am
Subject: Re: [OpenBD] CFQUERY cache key collisions

Unless I'm mistaken, you don't need the cachedwithin parameter since the
cachename will cache the result until you will flush the cache.

In any case, what happens when you remove the cachedwithin part? Same issue
or solved?

I would have run into this many times, because we use cachename and
cachedomain extensively.

Kind Regards,
Nitai

--
See for yourself how easy it is to manage files today. Join the revolution!

Razuna - Hosted Digital Asset Management Solution
http://www.razuna.com/

Razuna - Open Source Digital Asset Management
http://www.razuna.org/

Twitter - http://twitter.com/razunahq
Facebook - http://www.facebook.com/razunahq
Support Platform - http://getsatisfaction.com/razuna


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jari Ketola  
View profile  
 More options Apr 11 2012, 9:00 am
From: Jari Ketola <ket...@gmail.com>
Date: Wed, 11 Apr 2012 06:00:39 -0700 (PDT)
Local: Wed, Apr 11 2012 9:00 am
Subject: Re: [OpenBD] CFQUERY cache key collisions

Hi Nitai,

Thanks for your reply. Cachedwithin doesn't affect the problem - the
collision happens with or without cachedwithin defined.

Of course it depends on the app, but I don't think cachename obsoletes
cachedwithin. There are quite a few places where we want cache to expire
without explicit purging, but still want to retain the option to flush the
entire cachedomain if needed. The fact that <cfquery datasource="ds"
action="flushall" cachedomain="domain" /> flushes all queries, not just the
ones with cachedomain=domain, is a different matter.

FWIW, we are using a query cache of 8192.

Jari


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jari Ketola  
View profile  
 More options Apr 16 2012, 7:23 am
From: Jari Ketola <ket...@gmail.com>
Date: Mon, 16 Apr 2012 04:23:16 -0700 (PDT)
Local: Mon, Apr 16 2012 7:23 am
Subject: Re: CFQUERY cache key collisions

Just bumping this up to check if anyone has tested the above case and
whether or not it causes a cache collision for them as well?

 Jari


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Wu  
View profile  
 More options Apr 17 2012, 12:26 pm
From: Andy Wu <a...@aw20.co.uk>
Date: Tue, 17 Apr 2012 17:26:52 +0100
Local: Tues, Apr 17 2012 12:26 pm
Subject: Re: [OpenBD] Re: CFQUERY cache key collisions
Hi Jari,

I've recreated this locally. Leave it with me and I'll get it fixed.

Andy

On 16/04/2012 12:23, Jari Ketola wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Wu  
View profile  
 More options Apr 17 2012, 3:27 pm
From: Andy Wu <a...@aw20.co.uk>
Date: Tue, 17 Apr 2012 20:27:10 +0100
Local: Tues, Apr 17 2012 3:27 pm
Subject: Re: [OpenBD] Re: CFQUERY cache key collisions
I've put a fix in for it.

It'll be in tonight's nightly build.

Thanks
Andy

On 17/04/2012 17:26, Andy Wu wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason King  
View profile  
 More options Apr 17 2012, 3:31 pm
From: Jason King <jasonalle...@gmail.com>
Date: Tue, 17 Apr 2012 14:31:01 -0500
Local: Tues, Apr 17 2012 3:31 pm
Subject: Re: [OpenBD] Re: CFQUERY cache key collisions

good job Andy!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Peter Farrell  
View profile  
 More options Apr 17 2012, 3:32 pm
From: Peter Farrell <pe...@mach-ii.com>
Date: Tue, 17 Apr 2012 14:32:33 -0500
Local: Tues, Apr 17 2012 3:32 pm
Subject: Re: [OpenBD] Re: CFQUERY cache key collisions

I'm curious what the problem that the fix fixed?
On Apr 17, 2012 2:27 PM, "Andy Wu" <a...@aw20.co.uk> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andy Wu  
View profile  
 More options Apr 17 2012, 3:40 pm
From: Andy Wu <a...@aw20.co.uk>
Date: Tue, 17 Apr 2012 20:40:56 +0100
Local: Tues, Apr 17 2012 3:40 pm
Subject: Re: [OpenBD] Re: CFQUERY cache key collisions

The cache name is normalized under the covers but in this case it was to
9 character key which was the same for quite different strings.

I've changed the normalization now so it's using MD5.

Andy

On 17/04/2012 20:32, Peter Farrell wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jari Ketola  
View profile  
 More options Apr 18 2012, 5:21 am
From: Jari Ketola <ket...@gmail.com>
Date: Wed, 18 Apr 2012 02:21:25 -0700 (PDT)
Local: Wed, Apr 18 2012 5:21 am
Subject: Re: [OpenBD] Re: CFQUERY cache key collisions

Excellent! Thank you very much, Andy. That's what I suspected was going on.
Strange that no-one else had stumbled upon the issue before. Even with all
the caching (both query and compiled pages) we're hitting around 600 qps on
our MySQL backends, so I guess it took these types of loads for the bug to
rear it's head.

Again, thank you very much for fixing the issue. It has been plaguing us
for years - from the days of NewAtlanta's BD.

 Jari


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jari Ketola  
View profile  
 More options Apr 23 2012, 2:06 am
From: Jari Ketola <ket...@gmail.com>
Date: Sun, 22 Apr 2012 23:06:53 -0700 (PDT)
Local: Mon, Apr 23 2012 2:06 am
Subject: Re: [OpenBD] Re: CFQUERY cache key collisions

Just wanted to confirm that the fix indeed solved the problem for us. No
collisions since I deployed the 2012-04-19 nightly build on all backend
servers last Friday.

Thanks again!

 Jari


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »