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

-- 
online documentation: http://openbd.org/manual/
   google+ hints/tips: https://plus.google.com/115990347459711259462
     http://groups.google.com/group/openbd?hl=en

Reply via email to