do caches fall back to default when cache stores are not there?

do caches fall back to default when cache stores are not there?

by John Nowlan -
Number of replies: 3

Hi,
I'm configuring caching. I have redis and memcached running on a seperate server. I've defined redis1 as a cache store and added several mappings with redis1 as the primary store and 'when no mapping is present' then 'default_application'. As a test when I stop redis, I get connect errors, but I was expecting it to fall back to 'default_application'. Isn't this what should happen? Is this expected behaviour? Am I doing something wrong?

Any help appreciated.

moodle 3.6.3
php 7.3.5
redis
memcached
oracle 12.1 (I'd love to move to pg, but that is another story)

Average of ratings: -
In reply to John Nowlan

Re: do caches fall back to default when cache stores are not there?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I don't think there's any failover built in.
In reply to Howard Miller

Re: do caches fall back to default when cache stores are not there?

by John Nowlan -
Thanks for the response. This seems to contradict the docs:
https://docs.moodle.org/38/en/Caching
" Getting data from a store
Moodle asks the cache to get the data. The cache attempts to get it from the first store. If the first store has it then it returns the data to the cache and the cache returns it to Moodle. If the first store doesn't have the data then it attempts to get the data from the second store. If the second store has it it returns it to the first store that then stores it itself before returning it to the cache. If it doesn't then the next store is used. This continues until either the data is found or there are no more stores to check."

- so maybe it is a case of the store has to be there, just not have the data for it to check the next store.
In reply to John Nowlan

Re: do caches fall back to default when cache stores are not there?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I think we're reading this differently. "the data isn't there" and "the store isn't working" are two rather different things.