Moodle

Context and modinfo caching regressions on large sites

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.9.5
  • Fix Version/s: 1.9.6
  • Component/s: Roles / Access
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

the array_shift() call is not correct because it reorders the array - see MDL-18768

From MDL-18768, by Colin Campbell:
I am running into issues with this fix. The array_shift function renumbers numeric indexes. Consequently, as soon as we reach MAX_MODINFO_CACHE_SIZE in get_fast_modinfo, array_shift converts the cache keys from the course ids originally used to index the cache to sequential integers starting with zero. This causes all sorts of bad things to happen.

Issue Links

Activity

Hide
Petr Škoda (skodak) added a comment -

fixed, going to add note into release notes

Show
Petr Škoda (skodak) added a comment - fixed, going to add note into release notes
Hide
Petr Škoda (skodak) added a comment -

All credit goes to Colin Campbell, thanks a lot!

Show
Petr Škoda (skodak) added a comment - All credit goes to Colin Campbell, thanks a lot!
Hide
Colin Campbell added a comment -

I see the fix to lib/accesslib.php. A similar defect was introduced at the same time in course/lib.php (which is actually the one that I was looking closely at). Please see the use of MAX_MODINFO_CACHE_SIZE in get_fast_modinfo. Thanks for addressing this issue so quickly.

Show
Colin Campbell added a comment - I see the fix to lib/accesslib.php. A similar defect was introduced at the same time in course/lib.php (which is actually the one that I was looking closely at). Please see the use of MAX_MODINFO_CACHE_SIZE in get_fast_modinfo. Thanks for addressing this issue so quickly.
Hide
Petr Škoda (skodak) added a comment -

oh, sorry - reopening

Show
Petr Škoda (skodak) added a comment - oh, sorry - reopening
Hide
Petr Škoda (skodak) added a comment -

reclosing, thanks a lot!

Show
Petr Škoda (skodak) added a comment - reclosing, thanks a lot!
Hide
Sam Hemelryk added a comment -

Hi guys, everything looks good, thanks

Show
Sam Hemelryk added a comment - Hi guys, everything looks good, thanks

People

Vote (0)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: