Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-42014

Session cache stops working after upgrade to 2.5.2

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Blocker Blocker
    • None
    • 2.5.2
    • Caching
    • MOODLE_25_STABLE
    • MDL-42014-master
    • Hide

      Do not run the upgrade just yet

      1. Add a few config stores
      2. Make sure they appear in the file moodledata/muc/config.php
      3. Hack the value of the default stores: default_application, default_session, default_request. And respectively set features to 2, 4 and 6.
      4. Access your front page, you should see many access to cachestore_dummy in the performance info
      5. Now run the upgrade
      6. Make sure the file moodledata/muc/config.php set back the value features of the default stores to 14.
      7. Make sure the stores you created before still exist.
      8. Going on your front page, you should not see any more usage of cachestore_dummy.
      Show
      Do not run the upgrade just yet Add a few config stores Make sure they appear in the file moodledata/muc/config.php Hack the value of the default stores: default_application, default_session, default_request. And respectively set features to 2, 4 and 6. Access your front page, you should see many access to cachestore_dummy in the performance info Now run the upgrade Make sure the file moodledata/muc/config.php set back the value features of the default stores to 14. Make sure the stores you created before still exist. Going on your front page, you should not see any more usage of cachestore_dummy.
    • 20
    • BACKEND Sprint 6

      Finally we were able to reproduce the caches problem that was reported in MDL-41942

      After the upgrade to 2.5.2 in datadir/muc/config.php the value

      $configuration['stores']['default_session']['features'] = 6;
      

      If you install the same version or just remove muc/config.php and let it to re-generate the value becomes 14.

      With this configuration and 2.5.2 code the session caches do not work at all - consecutive set() and get() inside the same request return false.

      To reproduce on dev sites just edit datadir/muc/config.php and substitute features value to 6.

      IMHO there are two problems here:

      • config.php is not regenerated during upgrade
      • difference 8 means 'IS_SEARCHABLE' which should not affect function get() anyway

      test script:

      <?php
       
      include "config.php";
       
      $coursecatcache = cache::make('core', 'coursecat');
      $key = uniqid('-randomkey-');
      $coursecatcache->set($key, 'Test value');
      $value = $coursecatcache->get($key);
      echo 'core/coursecat : ';
      echo ($value === false) ? 'FAILED' : 'OK';
       
      $cache = cache::make_from_params(cache_store::MODE_SESSION, 'testing', 'sessioncachetest');
      $key = uniqid('-randomkey-');
      $cache->set($key, 'Test value');
      $value = $cache->get($key);
      echo '; test session cache : ';
      echo ($value === false) ? 'FAILED' : 'OK';
      

            fred Frédéric Massart
            marina Marina Glancy
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.