Commit Graph

71 Commits

Author SHA1 Message Date
Brion Vibber
aff78e5121 Cache fixes:
* We now cache negative lookups; clear them in Memcached_DataObject->insert()
* Mark file.url as a unique key in statusnet.ini so its negative lookups are cleared properly (first save of a notice with a new URL was failing due to double-insert)
* Now using serialization for default in-process cache instead of just saving objects; avoids potential corruption if you save an object to cache, change the original object, then fetch the same key from cache again
2010-01-05 15:05:53 -08:00
Evan Prodromou
4e84c523b7 Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Conflicts:
	classes/Memcached_DataObject.php
2010-01-04 22:50:04 -10:00
Evan Prodromou
7aeb11bb07 Merge branch 'master' into 0.9.x
Conflicts:
	actions/publictagcloud.php
	classes/Memcached_DataObject.php
2010-01-04 15:14:54 -10:00
Brion Vibber
78214c4e06 Exclude process-specific link & result cache references from serialized Memcached_Data_Object instances.
Should fix seemingly-random bugs due to destructor free()ing local resources by mistake.

cherry-pick from 0.9.x
2010-01-04 14:38:56 -08:00
Brion Vibber
8f02379f6e Revert "Take Memcached_DataObject destructor back out to check whether it might be causing some under-the-hood problems."
This reverts commit 89cca01259.
2010-01-04 14:37:39 -08:00
Brion Vibber
440b9957f9 Exclude process-specific link & result cache references from serialized Memcached_Data_Object instances.
Should fix seemingly-random bugs due to destructor free()ing local resources by mistake.
2010-01-04 14:30:45 -08:00
Evan Prodromou
abc9b33241 Memcached_DataObject stores empty values in the cache
There's great value in knowing that something doesn't exist. We
now cache this information, and carefully compare the results from
cache as $results !== false instead of !empty($results), since some
empty values (null, 0, empty array, empty string) are stored in the
cache.

Caching staticGet() and pkeyGet() now store DB misses in the cache,
and cachedQuery() checks for empty results from the cache.
2010-01-04 10:00:17 -10:00
Evan Prodromou
5a1ea0b9b2 Stop caching unfindable keys
There were some problems with the automated cache/uncache system
for data objects that made us cache unfindable keys (with null
attributes and sometimes null names). Fixed those problems and
refactored the encache() and decache() methods so they use a helper
to find the cache keys to use.
2010-01-04 08:59:19 -10:00
Evan Prodromou
d5fb88e1c0 Revert "use keys() instead of keyTypes() so plugin data object work"
This reverts commit ec380887f7.
2010-01-03 11:24:05 -10:00
Evan Prodromou
ec380887f7 use keys() instead of keyTypes() so plugin data object work 2010-01-03 10:52:24 -10:00
Evan Prodromou
90a2563a90 Merge branch 'master' into 0.9.x
Conflicts:
	classes/Memcached_DataObject.php
2010-01-02 19:47:34 -10:00
Evan Prodromou
d32fb7c7c4 return false from Memcached_DataObject::staticGet() on not found, like DB_DataObject 2010-01-02 16:28:46 -10:00
Evan Prodromou
2bd32dfad7 change harmless check of to check of in Memcached_DataObject 2010-01-02 16:21:19 -10:00
Evan Prodromou
d2bbf65f19 Merge branch 'master' of git@gitorious.org:statusnet/mainline 2010-01-01 11:27:28 -10:00
Evan Prodromou
79c2e3f720 Revert "add cleanup method to cleanup a single row"
This reverts commit b0527801d9.
2010-01-01 11:27:13 -10:00
Evan Prodromou
a9d8359208 Merge branch 'master' into 0.9.x
Conflicts:
	classes/Memcached_DataObject.php
2010-01-01 11:20:25 -10:00
Evan Prodromou
b0527801d9 add cleanup method to cleanup a single row 2010-01-01 11:02:56 -10:00
Evan Prodromou
727978332a stop using DB_DataObject's staticGet() which caches 2010-01-01 10:57:22 -10:00
Brion Vibber
89cca01259 Take Memcached_DataObject destructor back out to check whether it might be causing some under-the-hood problems. 2009-12-30 16:42:57 -08:00
Brion Vibber
ff50c2b91d Revert debugging code 2009-12-30 16:40:59 -08:00
Brion Vibber
9218cce3cd subbug debug info to check on free ordering 2009-12-30 15:55:15 -08:00
Evan Prodromou
3262930ed4 Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x 2009-12-23 10:31:27 -08:00
Evan Prodromou
f6bf952980 Merge branch 'testing' 2009-12-22 16:44:19 -08:00
Brion
38877a4922 Skip DB_DataObject's in-process cache for static gets on CLI processes.
The local process cache would grow forever, keeping things stuck in memory and preventing GC.
2009-12-22 16:24:01 -08:00
Evan Prodromou
22f02b35ad call DB_DataObject::__destruct() if it exists 2009-12-15 12:38:15 -05:00
Evan Prodromou
945661d942 take out DB_DataObject destructor 2009-12-15 12:33:17 -05:00
Brion Vibber
b9040a7cc4 Add destructor on Memcached_DataObject to free DB_DataObject's global storage for an object when that object itself is destroyed.
Reduces some, but not all, memory leakage for long-running processes.
2009-12-14 16:36:01 -08:00
Brion Vibber
727357695e Debug check to track down live error -- wrong data type sometimes being sent down to Memcached_DataObject::cacheKey() via various fetch functions, need a backtrace to track it down. 2009-12-11 14:19:18 -08:00
Brion Vibber
53c86c43c4 Bringing Sphinx search support up to code: broken out to a plugin, now supports multiple sites on a single server.
Upgrade notes:
* Index names have changed from hardcoded 'Identica_people' and 'Identica_notices' to use the database name and actual table names. Must reindex.

New events:
* GetSearchEngine to override default search engine class selection from plugins

New scripts:
* gen_config.php generates a sphinx.conf from database configuration (with theoretical support for status_network table, but it doesn't seem to be cleanly queriable right now without knowing the db setup info for that. Needs generalized support.)
* Replaced old sphinx-indexer.sh and sphinx-cron.sh with index_update.php

Other fixes:
* sphinx.conf.sample better matches our live config, skipping unused stopword list and using a more realistic indexer memory limit

Further notes:
* Probably doesn't work right with PostgreSQL yet; Sphinx can pull from PG but the extraction queries currently look like they use some MySQL-specific functions.
2009-11-10 13:44:40 -08:00
Evan Prodromou
df86aa7214 define LACONICA and accept LACONICA for backwards compatibility 2009-08-26 10:41:36 -04:00
Evan Prodromou
865b716f09 change LACONICA to STATUSNET 2009-08-25 18:42:34 -04:00
Evan Prodromou
4737563b95 a distributed -> the distributed 2009-08-25 18:14:12 -04:00
Evan Prodromou
c8b8f07af1 change Laconica and Control Yourself to StatusNet in PHP files 2009-08-25 18:12:20 -04:00
Evan Prodromou
a5f78449b1 better check for existing DB connection runs SET NAMES UTF8 less 2009-07-27 13:51:40 -04:00
Evan Prodromou
d4db9d83d8 Revert "Merge branch '0.8.x' into cachenonexistent"
This reverts commit e21d2cfdb5.
2009-07-05 12:44:18 -04:00
Evan Prodromou
9f6bea473e cache failure to find in memcached 2009-07-05 11:31:39 -04:00
Evan Prodromou
876ab05927 Add like for search 2009-06-21 21:50:35 -07:00
Evan Prodromou
aec6456c91 Update copyright dates in files modified in 2009 2009-06-20 16:12:55 -07:00
Evan Prodromou
793a6a1155 change Controlez-Vous to Control Yourself 2009-06-20 16:00:04 -07:00
Zach Copley
e0fb15c185 Make sure we have a DB connection before setting its charset 2009-06-18 19:19:19 +00:00
Evan Prodromou
9e16b7d89b Use mysql_set_charset for connection instead of SET NAMES
PHP doesn't get the info about the charset of the connection if
you use SET NAMES. So, we use the appropriate PHP function instead.
2009-05-30 13:59:57 -04:00
Evan Prodromou
d068680e19 optionally use SET NAMES for utf8 to DB 2009-05-27 14:57:45 -04:00
Evan Prodromou
698228acb9 Revert "Revert "run 'set names' after each connection to deal with UTF8 correctly""
This reverts commit 86770ccde7.
2009-04-26 13:16:59 -04:00
Evan Prodromou
86770ccde7 Revert "run 'set names' after each connection to deal with UTF8 correctly"
This reverts commit 84072aa5cf.

This commit caused grievous harm to old notices on identi.ca.
Reverting until we figure out how to convert the old notices.
2009-04-26 12:28:20 -04:00
Evan Prodromou
a7089de228 run 'set names' after each connection to deal with UTF8 correctly 2009-04-26 12:14:04 -04:00
Evan Prodromou
96bcfa4981 Was accidentally not saving cached items (doh!) 2009-01-22 20:51:05 +00:00
Evan Prodromou
0642b6aa63 Fixed bug in caching of queries 2009-01-22 20:16:19 +00:00
Evan Prodromou
dde1c00ce7 Return $inst, not $cls, if no cache in Memcached_DataObject 2009-01-22 19:54:05 +00:00
Evan Prodromou
8c79646e53 Add a method the memcached_object that lets it cache query results 2009-01-22 19:13:26 +01:00
Evan Prodromou
04ef1ba8ee change function headers to K&R style
Another huge change, for PEAR code standards compliance. Function
headers have to be in K&R style (opening brace on its own line),
instead of having the opening brace on the same line as the function
and parameters. So, a little perl magic found all the function
definitions and move the opening brace to the next line (properly
indented... usually).

darcs-hash:20081223193323-84dde-a28e36ecc66672c783c2842d12fc11043c13ab28.gz
2008-12-23 14:33:23 -05:00