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

Session cache stops working after upgrade to 2.5.2

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.5.2
    • Fix Version/s: None
    • Component/s: Caching
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-42014-master
    • Story Points:
      20
    • Sprint:
      BACKEND Sprint 6

      Description

      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';
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fred Frédéric Massart
              Reporter:
              marina Marina Glancy
              Participants:
              Component watchers:
              Matteo Scaramuccia, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: