-
Improvement
-
Resolution: Fixed
-
Major
-
4.5
-
MOODLE_405_STABLE
-
MOODLE_405_STABLE
-
main_
MDL-66151 -
-
Team Hedgehog 2024 Sprint 2.1, Team Hedgehog 2024 Sprint 2.2, Team Hedgehog 2024 Sprint 2.3, Team Hedgehog 2024 Review 2, Team Hedgehog 2024 Sprint 3.1, Team Hedgehog 2024 Sprint 3.2
THIS IS AN MUA PROJECT PROPOSAL THAT WILL BE OR HAS BEEN SUBMITTED FOR POSSIBLE MUA FUNDING. ANY EXISTING TRACKER ITEMS THAT THIS MIGHT DUPLICATE SHOULD BE LINKED TO BELOW.
The current session store interface leaves some parts of the session managed by core in mdl_sessions. So this table gets a lot of contention even if you push it of to redis. This seems to surprise a lot of people that moodle still touches mdl_sessions and is counter intuitive.
I believe the main historical reason for this is that some session stores are simple key / value stores and so things like 'how many sessions do I have' is hard / impossible / slow. But this isn't the case with many potential implementations, eg redis.
Proposing:
1) Move any functionality that touches the session table into new methods in the handler.php abstract class which do exactly the same thing.
eg some example new methods:
get_session_metadata($sid)
would be called here:
The naming / interface of these methods would be carefully constructed by design so that some of them could serve double duty and one of them would be a noop.
2) Slightly improve the performance of the session/database.php so it only touches the tables once instead of twice,. eg updating the session data, and updating the session metadata would be done in the same method.
3) For certain session stores like redis, override these methods so that mdl_session isn't touched at all. As above, it would save and read all session data and metadata in a single redis call.
- blocks
-
MDL-68689 redis session uses us instead of ms for retry_interval
- Open
-
MDL-69747 Convert redis session store to use a HASH for smaller delta writes
- Open
-
MDL-71768 More tuning of the redis session handler to reduce blocking wait time
- Open
- caused a regression
-
MDL-83085 Exception - Unknown named parameter $read_timeout after MDL-66151
- Closed
-
MDL-83158 Unknown exception when starting database session : dummy - Undefined property: stdClass::$id on PHPUnit runs
- Closed
-
MDL-83205 Redis set EXPIRE can't be < 1
- Closed
-
MDL-83811 Windows GHA runs are failing
- Closed
- has been marked as being related by
-
MDL-74389 core_session_touch doesnt need a session lock
- Open
- has to be done before
-
MDL-81848 Final deprecation of \core\session\manager::kill_session etc
- Open
- is blocked by
-
MDL-69684 It's possible to hold a redis session lock forever
- Closed
- will help resolve
-
MDL-81987 1-second Redis timeout causes exceptions instead of degraded performance
- Closed