Commit Graph

38 Commits

Author SHA1 Message Date
Andrew Nicols 28bf0a03a7 MDL-56675 cachestore_memcached: Check all connected servers for support 2017-05-04 13:11:07 +08:00
Andrew Nicols 77f1729eec MDL-56675 cachestore_memcached: Disable store if not purgeable
If the store is shared and the getAllKeys function is broken due to an
incompatability between libmemcached and memcached >= 1.4.23, then it is
not possible to purge the cache, and we cannot support the plugin.

This patch adjusts the isready check to additionally check if the
combination of libmemcached and memcached is affected by this issue.
2017-05-03 09:24:23 +08:00
Rajesh Taneja 4a910b9aa6 MDL-56273 cache: Fixed initialise call
After store is created, it should be checked if
it's ready before calling initialise
2016-11-02 14:26:50 +08:00
Russell Smith a169739d5d MDL-56273 cache: Use cache initialise always.
purge_all() and purge_by_definition() look in the configuration
for which caches are available and then creates them to purge them.
The configuration stores the values used by initialise(), not
initialise_unit_test_instance() and would therefore fail to purge
all caches if they were not purged by another means.

In the case of filestore, it's purged by unit tests, in the case
of memcache(d), it purges the whole store when a single definition
is requested.

Therefore all configuration was moved into the configuration file
during unit tests and does not have any special override codes in
the unit test infrastructure.
2016-10-30 13:42:43 +11:00
Skylar Kelty 216b7f7577 MDL-53967 caching: Ensure getAllKeys returns a valid array 2016-04-29 12:14:34 +01:00
Ryan Wyllie 33688fbfe6 MDL-48506 cachestore_memcached: added shared cache config option
When added a memcached instance you can now select whether the cache is
being shared by other applications. The setting will determine the
purging strategy.

Shared caches will have individual keys deleted while dedicated caches
will have the entire cache purged (better performance over networks).

Note: This option only works with the correct version of the php
memcached extension and with the multi-site safe changes.
2016-04-18 07:18:24 +00:00
Sam Hemelryk 957e0c7567 MDL-48506 cachestore_memcached: is now multi-site safe 2016-04-18 06:56:46 +00:00
Russell Smith b2159f2d3f MDL-53208 caching: Enable dereferencing as a feature.
If the cache does all the dereferencing when it stores and loads
the objects, then the cache loaders don't need to do that work.
This is true of all caches that use something other than PHP's memory
to store their results.
2016-02-28 17:01:49 +11:00
Sam Hemelryk 63b159d0d4 MDL-48568 cache: stores now determine testing
Cache stores are now responsible for deciding if they are suitable
for use as the primary cache store during unit and acceptance tests

Changes are as follows:
* New method: cache_store::ready_to_be_used_for_testing
* Core cache store have been updated to override this method as
  required.
* MongoDB usesafe default changed to true to match actual default
  behaviour.
2014-12-12 09:30:46 +13:00
Sam Hemelryk 1b5b97fac5 MDL-47917 cachestore_memcached: fixed get_many ordering 2014-11-03 14:08:25 +13:00
Eric Merrill e75becf3b3 MDL-46796 caching: Fix missing property error for memcache(d) 2014-08-13 08:24:04 -04:00
Sam Hemelryk 727c21733e MDL-45724 cache: admin screen now shows store warnings
Implemented a means by which cache store instance can communicate
warnings due to things such as conflicting configurations etc.
2014-07-18 08:29:41 +12:00
Eric Merrill 1c0518a625 MDL-42071 caching Support for clustered memcached caching
For stores where there is a very high rate of sets compared to gets, it
is beneficial to retrieve from the local server, skipping the network
overhead, at the expense of having to set many severs when a key is set.

This patch adds a memcached option to enable clustering. When on, only
one "server" is allowed, which will be where fetches are from, while
sets/updates/deletes/purges will occur to the all the servers in the
"set server" list.

To run unit tests, define TEST_CACHESTORE_MEMCACHED_TESTSERVERS with
multiple (return delimited) servers.
2014-06-29 23:02:06 -04:00
Sam Hemelryk eefb680d8e MDL-45513 cache: implemented defines for unit testing alternative caches 2014-05-30 08:41:07 +12:00
Michael Aherne 90a3a62096 MDL-44066 caching Don't advertise session mode for MongoDB and memcached 2014-02-05 10:48:22 +00:00
sam marshall 5c138b258d MDL-42839 MUC: Memcache server configuration too sensitive to whitespace 2013-11-12 12:33:36 +00:00
Matteo Scaramuccia a94bc886bb MDL-41410 Caching: move comment to the appropriate place.
MDL-38162 fixes the issue about testing the connection to the memcached
daemon, which means testing once the connection to the pool of servers
and not to each of the servers while being added to the pool.
It misses to move the comment to that code too.
2013-08-25 14:00:47 +02:00
Eloy Lafuente (stronk7) 9e1e94aafa Merge branch 'wip-MDL-40700-m26' of git://github.com/samhemelryk/moodle 2013-07-23 13:58:20 +02:00
Sam Hemelryk 7dfa10b02e MDL-40700 cache: memcache and memcached stores now allow alphanumext prefixes 2013-07-22 10:41:38 +12:00
Dan Poltawski a10d6199c8 MDL-40680 store_memcached: fix serialiser options
* Use correct lang string for SERIALIZER_IGBINARY
* Use PARAM_INT for the parameter
2013-07-16 09:37:53 +08:00
sam marshall cb86f1ebb3 MDL-39472 MUC: Improve parse_key performance 2013-05-02 16:04:29 +01:00
Sam Hemelryk ff6f9d3aa6 MDL-38162 memcache: fixed up the memcache plugins 2013-02-22 14:23:18 +13:00
Sam Hemelryk bb4c391688 MDL-37645 cache: fixed issue deleting mongo instance 2013-02-08 08:06:21 +13:00
Sam Hemelryk 65b3edc450 MDL-36322 cache: cache stores now test connections during construction 2013-02-01 08:49:03 +13:00
Matteo Scaramuccia f4cec2ec87 MDL-36322 Errors when updating a Moodle instance with some misconfigured cache stores 2013-02-01 08:49:03 +13:00
Sam Hemelryk a037c943bd MDL-36363 cache: clean up pre-integration 2013-01-28 10:39:23 +13:00
Matteo Scaramuccia 59ca73ff82 MDL-36363 Override instance_deleted() for all cache stores performing just a cleanup() when this action successfully applies over all the definitions of the cache store 2013-01-28 10:39:23 +13:00
Sam Hemelryk 2b274ad001 MDL-36819 cache: implemented cache_is_configurable interface 2012-11-26 14:27:44 +13:00
Sam Hemelryk 75cde6b9ac MDL-36768 cache: replaced cache_store interface with abstract class 2012-11-26 14:11:01 +13:00
Sam Hemelryk bd188851f2 MDL-36768 cache: Implemented abstract cache store base class 2012-11-26 08:12:45 +13:00
Sam Hemelryk 758dbdf894 MDL-36111 cache: Fixed up typo's and trivial issues 2012-11-12 10:36:53 +13:00
Sam Hemelryk d837df0d77 MDL-36381 cachestores: fixed bug when editing with checkbox/bool 2012-11-09 00:01:30 +01:00
Sam Hemelryk 81ede547f2 MDL-36381 cache: fixed bug whereby you couldn't edit store instances 2012-11-08 10:54:11 +13:00
Sam Hemelryk 42f5d1648d MDL-25290 cache: Fixed up memcache server settings and a couple of minor things 2012-10-08 09:53:52 +13:00
Sam Hemelryk 170f821b9d MDL-25290 cache: Fixed things up per coding style 2012-10-08 09:53:52 +13:00
Sam Hemelryk 34c84c723a MDL-25290 cache: Added cache locking plugin and converted locking implementations to that 2012-10-08 09:53:51 +13:00
Sam Hemelryk 6fec18203b MDL-25290 cache: Renamed plugin from cache => cachestore 2012-10-08 09:53:51 +13:00
Sam Hemelryk 47d89ccfa5 MDL-25290 cache_memcached: Added Memcached cache store 2012-10-08 09:53:51 +13:00