522 Commits

Author SHA1 Message Date
Ilya Tregubov
4fa5a40f34
Merge branch 'MDL-76865-master' of https://github.com/daledavies/moodle 2023-09-06 14:48:15 +08:00
Ilya Tregubov
b327210cd2
Merge branch 'MDL-78615' of https://github.com/paulholden/moodle 2023-08-29 13:32:46 +08:00
Brendan Heywood
482758b1df MDL-79150 cache: Improve requirelockingwrite error 2023-08-24 10:39:12 +10:00
Paul Holden
8462e7880d
MDL-78615 cache: display failure notifications deleting lock/store. 2023-08-21 10:45:11 +01:00
Dale Davies
af91ae626a MDL-76865 core: Check lock state before attempting to acquire a lock 2023-08-14 12:34:14 +01:00
sam marshall
8df2ac4e98 MDL-78109 core_cache: Remove harmful requirelockingwrite/read options
These cache options are not used in core and would cause a performance
cost without any benefit if ever used. Also they don't work properly.
2023-07-12 15:33:15 +01:00
Andrew Nicols
d1effac984
Merge branch 'MDL-78552' of https://github.com/skodak/moodle 2023-06-29 11:34:53 +08:00
Srdjan
38076e5a0d MDL-72622 core: Support TLS for redis cache connections 2023-06-27 09:49:33 +10:00
Petr Skoda
3c25ccdcd1 MDL-78552 core: tidy up MDL_PERF constants
* all constans usable in ABORT_AFTER_CONFIG should be always defined
* MDL_PERFDB and $PERF->logwrites not used after legacy log removal
* MDL_PERF_TEST should be documented in codebase
* deprecated warnings in shutdowb manager
2023-06-25 08:39:09 +02:00
Andrew Nicols
c40cf46b22 Merge branch 'MDL-78004_master' of https://github.com/mwehr/moodle 2023-06-22 14:29:41 +02:00
Sara Arjona
8d050aa330 Merge branch 'MDL-69653' of https://github.com/paulholden/moodle 2023-06-14 17:49:49 +02:00
Paul Holden
c21a4aebeb
MDL-69653 cache: final removal of deprecated lock methods. 2023-06-14 16:19:57 +01:00
Andrew Nicols
5138f02dd3
MDL-78466 cache: Add new result_found helper
This helper is intended to prevent recurrences of this issue by moving
the guess-work to something well tested.
2023-06-14 11:58:12 +08:00
Andrew Nicols
5c6ebcd5f5
MDL-78466 cache: Perform strict test on static cache values
If a statically accelerated cache returns an empty array then the value
was still fetched from the non-static cache store.

The check of the `$result` should be strictly checked against `false`,
which is the value used if no value was found.
2023-06-14 09:28:53 +08:00
Jun Pataleta
0dce9fe077 Merge branch 'MDL-76745_master' of https://github.com/marxjohnson/moodle 2023-06-07 22:54:27 +08:00
Mark Johnson
09cf1b8818 MDL-76745 cache: Implement cache_loader_with_locking in cache_disabled
If a plugin attempts to do something that would lock coursemodinfo cache
during install (such as creating a course module), this currently fails
as check_lock_state is not implemented in cache_disabled. Adding the
cache_loader_with_locking interface ensures that all lock methods are
implemented.
2023-06-01 15:03:01 +01:00
Jun Pataleta
71216a0b1d Merge branch 'MDL-78092-master' of https://github.com/sammarshallou/moodle 2023-06-01 11:36:44 +08:00
Jonathan Champ
e32cf94b9b MDL-78383 cache: Remove unused class property configlockmappings 2023-05-30 19:46:03 -04:00
Wehr Mario
fbe936cef7 MDL-78004 cache: Fix deprecated null value in Redis connect 2023-05-26 13:25:19 +02:00
sam marshall
a2af6bd669 MDL-78092 Cache: Modinfo locking with Redis store does not work
The feature added in 4.1 to lock the modinfo cache does not work when
using Redis, because:

* The API to acquire a cache lock is confusing, and the code did not
  check that it successfully acquired a lock before going on to build
  the cache anyway.

* Unlike the other types of cache lock, the Redis store did not retry
  the lock for a timeout period before giving up and failing.

This change fixes both points.
2023-05-22 10:43:14 +01:00
Meirza
691d80fdae MDL-77350 cache: Added class properties that are not declared
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.
2023-05-16 00:33:20 +07:00
Eloy Lafuente (stronk7)
061c9d7ba0 MDL-77940 versions: bump all versions and requires near release
version = 2023042400 release version
requires= 2023041800 current rc1 version
2023-04-18 18:08:09 +02:00
Marina Glancy
8fc1486d36 MDL-77164 various: fix incorrect phpdocs 2023-04-13 11:35:06 +01:00
Ilya Tregubov
25254ceea3 Merge branch 'MDL-77163-master' of https://github.com/andrewnicols/moodle 2023-03-08 17:28:13 +08:00
Andrew Nicols
8ae5ebb507 MDL-77163 cachestore_mongodb: Remve from core 2023-02-28 22:24:04 +08:00
sam marshall
a3b1e3b4ee MDL-76784 core_cache: versioned cache (modinfo) can fail in install
When cache is disabled but temporary in-memory caches are allowed,
these were direct instances of cachestore_static with no loader, which
meant that the get_versioned and set_versioned functions did not work.
2023-02-21 10:40:23 +00:00
Andrew Nicols
6d31626130 Merge branch 'MDL-76791-master' of https://github.com/sammarshallou/moodle 2023-02-16 10:53:25 +08:00
David Woloszyn
02418cc093 MDL-75454 cache: Reduced exposure of sesskey param 2023-02-14 11:25:49 +11:00
Andrew Nicols
7bf57d9850 MDL-77161 cachestore_memcached: Remove from core 2023-02-07 21:42:50 +08:00
sam marshall
3353aecc8b MDL-76791 core_cache: Locking breaks for multiple-identifiers store
Cache locking fails if the cache store supports multiple identifiers
(in core, the only two which do are cachestore_static and
cachestore_mongodb, so this is unlikely to cause severe problems).
2023-02-06 15:46:17 +00:00
Marina Glancy
b0a83aa7bd MDL-76362 various: Avoid passing nulls to functions that don't allow nulls
PHP 8.1 is more strict on the parameter type. Functions such as trim(), strlen(), str_replace(), etc
show notice when null is passed as an argument
2023-01-23 09:15:54 +08:00
Jun Pataleta
db2ee34986 Merge branch 'MDL-76506' of https://github.com/jrchamp/moodle 2023-01-09 19:34:07 +08:00
Sara Arjona
3dd93ffc5e Merge branch 'MDL-76617' of https://github.com/stronk7/moodle 2022-12-28 12:42:12 +01:00
Eloy Lafuente (stronk7)
47435471ee MDL-76617 store_mongodb: Adjust moodle to mongo-php-library to v1.15.0
The new library version should work without problems with older
php-mongodb extension versions:
- v1.15.0 (paired version, tested).
- v1.14.1 (tested)

But, in order to keep them paired, the requirements have been
raised to the extension v1.15.0. See:

https://www.mongodb.com/docs/drivers/php/#compatibility
2022-12-22 19:36:36 +01:00
Eloy Lafuente (stronk7)
c5efd54971 MDL-76617 store_mongodb: Update mongo-php-library to v1.15.0
This updates the library from v1.13.1. Fixes some php81 warnings
leading to failed/risky tests.

The new library version should work without problems with older
php-mongodb extension versions:
- v1.15.0 (paired version, tested).
- v1.14.1 (tested)
2022-12-22 19:36:36 +01:00
sam marshall
0b2c2a1f95 MDL-76129 upgrade: Allow caching in specific functions
During install/upgrade, caching is disabled. This change provides a
way to temporarily enable caching (using in-memory cache storage only)
within a specific function; caches are deleted afterwards.

Adding this to two locations improves install performance quite a lot.

Caching is not enabled during the parts of plugin installation that
can vary for individual plugins (install.php/upgrade.php) as these
might be relying on its absence, for example by making direct database
changes.
2022-12-22 11:05:45 +00:00
Andrew Nicols
0646f7ea5a Merge branch 'MDL-76183-master' of https://github.com/davewoloszyn/moodle 2022-12-01 08:55:34 +03:00
Andrew Nicols
b1e77fe1f3 Merge branch 'MDL-76218-master' of https://github.com/sammarshallou/moodle 2022-12-01 08:55:34 +03:00
David Woloszyn
126028cc76 MDL-76183 lib: Update Github URLs 2022-11-30 14:01:31 +11:00
Jonathan Champ
a45c8120c9 MDL-76506 cache_application: Fix MDL_PERF and perfdebug checks 2022-11-29 13:27:31 -05:00
Jun Pataleta
00bae8b8a4 MDL-76403 versions: bump all versions and requires near release 2022-11-23 09:45:23 +08:00
sam marshall
5f5f922fd8 MDL-76218 cachestore_redis: delete_many can fail with no keys
In some cases, we get an error message such as:

Wrong parameter count for Redis::zRem()

Within the delete_many function. This function requires at least one
key to be supplied, but if delete_many is called with an empty array,
we will call it with no keys.
2022-11-14 14:40:09 +00:00
Jun Pataleta
5339a96f45 Merge branch 'MDL-75481-master' of https://github.com/kevpercy/moodle 2022-11-04 12:06:38 +03:00
Mark Johnson
67c7ed25e3 MDL-76076 cache: Add locking before write for parent caches 2022-10-31 13:55:54 +00:00
Mark Johnson
045ee091da MDL-67020 Cache: Make locking work for local file caches
* Add new requirelockingbeforewrite flag for cache definitions
* Implement native locking in cachestore_file (leveraging
file_lock_factory).
2022-10-20 11:31:33 +01:00
Mark Johnson
c06fc0648d MDL-67020 Cache: Release locks in cache_application::get_many() 2022-10-19 09:04:33 +01:00
Kevin Percy
25ad0a2cba MDL-75481 lib: Update MongoDB library references to 1.13.1 2022-10-17 11:58:05 +08:00
Kevin Percy
8ab37cea82 MDL-75481 lib: Updated MongoDB files to 1.13.1 2022-10-13 15:22:01 +08:00
Jun Pataleta
45a44ec0f0 Merge branch 'MDL-71531-master' of https://github.com/andrewnicols/moodle 2022-09-27 16:30:23 +08:00
Andrew Nicols
d51d901215 MDL-71531 cachestore_file: Stop locking cache files to read
The cache file is only ever written to in the `write_file` function,
where it does so by writing to a temp file and performing an atomic
rename of that file. When writing, the target file is never locked.

The cache file is only ever read in the `get` function, and there is no
need for an exclusive lock in that situation.

There is therefore no need to obtain any lock, shared or exclusive, to
read the cache file. Doing so only affects performance of the file sytem
as file locks must be needlessly obtained and written to disk for a read
operation which does not benefit from them.
2022-09-15 10:13:32 +08:00