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

Stacked coursemodinfo cache broken due to requirelockingbeforewrite

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.1
    • 4.1
    • Caching
    • MOODLE_401_STABLE
    • MOODLE_401_STABLE
    • MDL-76076_master
    • Hide

      Set coursemodinfo cache to use a single store.

      Show
      Set coursemodinfo cache to use a single store.
    • Hide

      Also covered by unit tests cache_test::test_application_locking_multiple_layers

      • As admin visit Site administration > Caching > Configuration
      • Click "Add instance" link in the "File Cache" to add a new instance.
      • Set the store name to "Local" and set the path to somewhere writable (e.g. /tmp/filecache). Tick "Auto create directory" checkbox and click "Save changes").
      • Under "Known cache definitions" section find "Accumulated information about modules and sections for each course" (coursemodinfo) and click "Edit mappings"
      • Set "Primary store" to "Local", "Final store" to "default_application", and click "Save changes"
      • Visit a course page
      • Visit the settings page and save changes
      • You should not see any error messages.
      Show
      Also covered by unit tests cache_test::test_application_locking_multiple_layers As admin visit Site administration > Caching > Configuration Click "Add instance" link in the "File Cache" to add a new instance. Set the store name to "Local" and set the path to somewhere writable (e.g. /tmp/filecache). Tick "Auto create directory"  checkbox and click "Save changes" ). Under "Known cache definitions" section find "Accumulated information about modules and sections for each course" (coursemodinfo) and click "Edit mappings" Set "Primary store" to "Local", "Final store" to "default_application", and click "Save changes" Visit a course page Visit the settings page and save changes You should not see any error messages.

      Steps to reproduce:

      • On latest master
      • Visit /cache/admin.php and add a new FIle Cache instance.
      • Set the store name to "Local" and set the path to somewhere writable (e.g. /tmp/filecache). Tick "Auto create directory" and click "Save changes").
      • Under "Known cache definitions" find "Accumulated information about modules and sections for each course" (coursemodinfo) and click "Edit mappings"
      • Set "Primary store" to "Local", "Final store" to "default_application", and click "Save changes"
      • You will see the error "Attempted to set cache key "1" without a lock. Locking before writes is required for core/coursemodinfo"

      This is due to the changes made in MDL-67020 not taking locking across multiple cache layers into account. A lock is not being created before attempting to set a key on a parent cache, or when reading a value from a parent cache and storing it in the child cache.

            marxjohnson Mark Johnson
            marxjohnson Mark Johnson
            Brendan Heywood Brendan Heywood
            Andrew Lyons Andrew Lyons
            Simey Lameze Simey Lameze
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 48 minutes
                1h 48m

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