[pLog-svn] Caching
Paul Westbrook
paul at westbrooks.org
Tue Apr 18 07:11:51 GMT 2006
Hello,
The problem of loosing an entry from my cache happened again
tonight. So I put this patch in cache.class.php:
> Index: cache.class.php
> ===================================================================
> --- cache.class.php (revision 3245)
> +++ cache.class.php (working copy)
> @@ -73,6 +73,11 @@
> $__cache_queries++;
> $data = $this->cache->get( $id, $group );
> +
> + if ( $id == 898 && $group == CACHE_ARTICLETEXT )
> + {
> + error_log( print_r( $data, true ) );
> + }
> if ($data) {
> $this->log->debug("Cache hit for $id
> ($group): $data", LOGGER_PRIO_INFO );
Since 898 is the id of the article that does not display.
I have included the output from that log file.
It looks like the call to $this->cache->get() is returning an array
of two articles (These are not even close to the one that I was
expecting. They don't even have the article id). Then when the code
in mapRow treats this array of articles and a single article, it all
of the expected indexes are missing.
I am not sure if the problem is on the retrieval or on the storing.
-------------- next part --------------
Array\n(
[0] => article Object
(
[_id] => 1
[_topic] => Congratulations, it worked!
[_text] => Welcome to pLog! If you can read this, it means that your pLog installation is ready and that you can start blogging.
[_categoryIds] => Array
(
[0] => 1
)
[_categories] =>
[_user] => 1
[_date] => 20040107130643
[_modificationDate] => 20060418015147
[_timestamp] => timestamp Object
(
[_timestamp] =>
[year] => 2004
[month] => 01
[day] => 07
[hour] => 13
[minute] => 06
[second] => 43
[partsecond] => 0
[tz] => date_timezone Object
(
[id] => UTC
[longname] => Coordinated Universal Time
[shortname] => UTC
[hasdst] =>
[dstlongname] => Coordinated Universal Time
[dstshortname] => UTC
[offset] => 0
[default] =>
)
[offset] => + 00:00
)
[_modificationTimestamp] => timestamp Object
(
[_timestamp] =>
[year] => 2006
[month] => 04
[day] => 18
[hour] => 01
[minute] => 51
[second] => 47
[partsecond] => 0
[tz] => date_timezone Object
(
[id] => UTC
[longname] => Coordinated Universal Time
[shortname] => UTC
[hasdst] =>
[dstlongname] => Coordinated Universal Time
[dstshortname] => UTC
[offset] => 0
[default] =>
)
[offset] => + 00:00
)
[_comments] =>
[_userInfo] =>
[_blog] => 1
[_blogInfo] =>
[_status] => 1
[_totalComments] => 0
[_numComments] => 0
[_numReads] => 46
[_numTrackbacks] => 1
[_totalTrackbacks] => 1
[_properties] => Array
(
[comments_enabled] => 1
)
[_timeOffset] => 0
[_fields] => Array
(
[date] => getDateWithoutOffset
[modification_date] => getModificationDateWithoutOffset
[user_id] => getUserId
[blog_id] => getBlogId
[status] => getStatus
[num_reads] => getNumReads
[properties] => getProperties
[slug] => getPostSlug
[num_comments] => getTotalComments
[num_trackbacks] => getTotalTrackbacks
[num_nonspam_trackbacks] => getNumTrackbacks
[num_nonspam_comments] => getNumComments
[global_category_id] => getGlobalCategoryId
[in_summary_page] => getInSummary
)
[_trackbacks] =>
[_slug] => congratulations_it_worked
[_nextArticle] =>
[_prevArticle] =>
[_globalCategory] =>
[_inSummary] => 1
[_customFields] =>
[_table] =>
[_pk] => id
[_class] =>
[unserializable] =>
[_globalCategoryId] => 0
)
[1] => article Object
(
[_id] => 2
[_topic] => 40s on 4
[_text] => I am not that in to big band music, but I really liked this channel. I like the fact that most of this music focuses on the music and not the production.\r
\r
[@more@]
[_categoryIds] => Array
(
[0] => 2
)
[_categories] =>
[_user] => 1
[_date] => 20040106133141
[_modificationDate] => 20060418015147
[_timestamp] => timestamp Object
(
[_timestamp] =>
[year] => 2004
[month] => 01
[day] => 06
[hour] => 13
[minute] => 31
[second] => 41
[partsecond] => 0
[tz] => date_timezone Object
(
[id] => UTC
[longname] => Coordinated Universal Time
[shortname] => UTC
[hasdst] =>
[dstlongname] => Coordinated Universal Time
[dstshortname] => UTC
[offset] => 0
[default] =>
)
[offset] => + 00:00
)
[_modificationTimestamp] => timestamp Object
(
[_timestamp] =>
[year] => 2006
[month] => 04
[day] => 18
[hour] => 01
[minute] => 51
[second] => 47
[partsecond] => 0
[tz] => date_timezone Object
(
[id] => UTC
[longname] => Coordinated Universal Time
[shortname] => UTC
[hasdst] =>
[dstlongname] => Coordinated Universal Time
[dstshortname] => UTC
[offset] => 0
[default] =>
)
[offset] => + 00:00
)
[_comments] =>
[_userInfo] =>
[_blog] => 1
[_blogInfo] =>
[_status] => 1
[_totalComments] => 0
[_numComments] => 0
[_numReads] => 13
[_numTrackbacks] => 1
[_totalTrackbacks] => 1
[_properties] => Array
(
[comments_enabled] => 1
)
[_timeOffset] => 0
[_fields] => Array
(
[date] => getDateWithoutOffset
[modification_date] => getModificationDateWithoutOffset
[user_id] => getUserId
[blog_id] => getBlogId
[status] => getStatus
[num_reads] => getNumReads
[properties] => getProperties
[slug] => getPostSlug
[num_comments] => getTotalComments
[num_trackbacks] => getTotalTrackbacks
[num_nonspam_trackbacks] => getNumTrackbacks
[num_nonspam_comments] => getNumComments
[global_category_id] => getGlobalCategoryId
[in_summary_page] => getInSummary
)
[_trackbacks] =>
[_slug] => 40s_on_4
[_nextArticle] =>
[_prevArticle] =>
[_globalCategory] =>
[_inSummary] => 1
[_customFields] =>
[_table] =>
[_pk] => id
[_class] =>
[unserializable] =>
-------------- next part --------------
--Paul
On Apr 13, 2006, at 11:33 PM, Paul Westbrook wrote:
> Hello,
> Unfortunately, I don't know how to reproduce this. It just
> happens after about 24 hours of access. I am getting about 10,000
> hits a day. I am not sure which access cause this problem.
>
> Thank you,
>
> Paul
>
>
> On Apr 13, 2006, at 10:09 PM, Mark Wu wrote:
>
>> Hi Paul:
>>
>> I got it.
>>
>> I will test it in this weekend! Thanks!
>>
>> BTW, how to reproduce this bug after I install your DB?
>>
>> Mark
>>
>>> -----Original Message-----
>>> From: plog-svn-bounces at devel.lifetype.net
>>> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of
>>> Paul Westbrook
>>> Sent: Thursday, April 13, 2006 10:29 PM
>>> To: plog-svn at devel.lifetype.net
>>> Subject: Re: [pLog-svn] Caching
>>>
>>> Hello,
>>> Here is the dump from my database
>>>
>>> http://www.westbrooks.org/lifetype.sql.gz
>>>
>>> I am using the plog_ db prefix.
>>>
>>>
>>> --Paul
>>>
>>>
>>> On Apr 12, 2006, at 3:15 AM, Mark Wu wrote:
>>>
>>>> So, weird.... :(
>>>>
>>>> Do you mind give me your db, or I don't think I can re-produce your
>>>> problem in my local environment.
>>>>
>>>> Mark
>>>>
>>>>> -----Original Message-----
>>>>> From: plog-svn-bounces at devel.lifetype.net
>>>>> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of Paul
>>>>> Westbrook
>>>>> Sent: Wednesday, April 12, 2006 6:02 PM
>>>>> To: plog-svn at devel.lifetype.net
>>>>> Subject: Re: [pLog-svn] Caching
>>>>>
>>>>> Hello,
>>>>> Even with the offset set to 0, the problem still happened.
>>>>> Tomorrow , if it happens again, I will look into it further.
>>>>>
>>>>> --Paul
>>>>>
>>>>>
>>>>> On Apr 11, 2006, at 9:29 AM, Jon Daley wrote:
>>>>>
>>>>>> Just guessing what is different between you and other
>>>>> people, though
>>>>>> presumably Oscar uses a time offset too.
>>>>>>
>>>>>> On Tue, 11 Apr 2006, paul at westbrooks.org wrote:
>>>>>>> Hello,
>>>>>>> No. I have reset it back to -3. I can change it back
>>> to 0, and
>>>>>>> leave it for a few days.
>>>>>>>
>>>>>>> Why do you think that this could be the problem? As far
>>>>> as I can
>>>>>>> tell, there is nothing in the caching code that uses the
>>> time zone
>>>>>>> offset.
>>>>>> _______________________________________________
>>>>>> pLog-svn mailing list
>>>>>> pLog-svn at devel.lifetype.net
>>>>>> http://devel.lifetype.net/mailman/listinfo/plog-svn
>>>>>>
>>>>>
>>>>> --
>>>>> Paul Westbrook
>>>>> paul at westbrooks.org
>>>>> <http://www.westbrooks.org>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> pLog-svn mailing list
>>>>> pLog-svn at devel.lifetype.net
>>>>> http://devel.lifetype.net/mailman/listinfo/plog-svn
>>>>
>>>> _______________________________________________
>>>> pLog-svn mailing list
>>>> pLog-svn at devel.lifetype.net
>>>> http://devel.lifetype.net/mailman/listinfo/plog-svn
>>>>
>>>
>>> --
>>> Paul Westbrook
>>> paul at westbrooks.org
>>> <http://www.westbrooks.org>
>>>
>>>
>>> _______________________________________________
>>> pLog-svn mailing list
>>> pLog-svn at devel.lifetype.net
>>> http://devel.lifetype.net/mailman/listinfo/plog-svn
>>
>> _______________________________________________
>> pLog-svn mailing list
>> pLog-svn at devel.lifetype.net
>> http://devel.lifetype.net/mailman/listinfo/plog-svn
>>
>
> --
> Paul Westbrook
> paul at westbrooks.org
> <http://www.westbrooks.org>
>
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://devel.lifetype.net/mailman/listinfo/plog-svn
>
--
Paul Westbrook
paul at westbrooks.org
<http://www.westbrooks.org>
More information about the pLog-svn
mailing list