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

Removing a file store cache instance should remove the folder too, at least remove the files representing the cached items

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4, 2.5
    • Fix Version/s: 2.4.2
    • Component/s: Caching
    • Testing Instructions:
      Hide

      Test 1: Test functionality.

      1. Open Site administration ► Plugins ► Caching ► Configuration
      2. Create a new file store (Add instance at the end of the row identified by column Plugin = File cache) in a Cache path really different from the default one e.g. /tmp/moodle-master-cache-file1
      3. Edit the Language string cache mapping and point it to the new file store
      4. Edit the Language string cache mapping and point it to the default store
      5. Check that cache files have been created as expected e.g. ls /tmp/moodle-master-cache-file1/*/.cache
      6. Remove the new file store
      7. Check that *.cache files have been removed from the folder used as the Cache path for the new file store
      8. Create a dummy cache file in the folder above e.g. touch /tmp/moodle-master-cache-file1/core_string/en_/TEST_DUMMY_KEY.cache keeping care of the R/W permission for the WebServer user
      9. Re-create the new file store with the same settings
      10. Check that the dummy cache file has been removed.

      Test 2: Test stores via performance.

      1. Install the following php extensions if you don't already have them: memcache, memcached, and mongodb.
      2. Configure two running instances of memcache.
      3. Browse to Settings > Plugins > Caches > Cache stores > Memcache and set up a test instance using the first running memcache.
      4. Browse to Settings > Plugins > Caches > Cache stores > Memcached and set up a test instance using the second running memcache.
      5. Browse to Settings > Plugins > Caches > Cache stores > Mongodb and set up the test instance.
      6. Browse to Settings > Plugins > Caches > Test performance.
      7. Check that all stores complete without error.
      Show
      Test 1: Test functionality. Open Site administration ► Plugins ► Caching ► Configuration Create a new file store ( Add instance at the end of the row identified by column Plugin = File cache ) in a Cache path really different from the default one e.g. /tmp/moodle-master-cache-file1 Edit the Language string cache mapping and point it to the new file store Edit the Language string cache mapping and point it to the default store Check that cache files have been created as expected e.g. ls /tmp/moodle-master-cache-file1/* / .cache Remove the new file store Check that *.cache files have been removed from the folder used as the Cache path for the new file store Create a dummy cache file in the folder above e.g. touch /tmp/moodle-master-cache-file1/core_string/en_/TEST_DUMMY_KEY.cache keeping care of the R/W permission for the WebServer user Re-create the new file store with the same settings Check that the dummy cache file has been removed. Test 2: Test stores via performance. Install the following php extensions if you don't already have them: memcache, memcached, and mongodb. Configure two running instances of memcache. Browse to Settings > Plugins > Caches > Cache stores > Memcache and set up a test instance using the first running memcache. Browse to Settings > Plugins > Caches > Cache stores > Memcached and set up a test instance using the second running memcache. Browse to Settings > Plugins > Caches > Cache stores > Mongodb and set up the test instance. Browse to Settings > Plugins > Caches > Test performance. Check that all stores complete without error.
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull Master Branch:
      wip-MDL-36363-m25

      Description

      If you remove the file store and you've created it with the "autocreate" option, the expected result is that the folder configured as "path" will be removed too.
      Besides before deleting a store it should be purged.

      For safety reasons, e.g. when using system folders with "autocreate", option it is wise to purge cached items leaving the folder there.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  1 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    11/Mar/13