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

Role definition caching & accesslib refactoring

XMLWordPrintable

    • MOODLE_29_STABLE, MOODLE_34_STABLE
    • MOODLE_34_STABLE
    • MDL-49398_final4
    • Hide
      Automated tests
      1. Run PHPUnit and Behat tests.
        • Confirm that everything passes.
      Manual testing
      Role assignment
      1. Enrol some users on a course, give them some roles
        • Confirm that you can assign roles
      2. Login as those users and confirm that you can login accordingly
      3. Confirm that you can rename a role within a course
      4. Confirm that you can create and assign a new role to someone.
      Role switching
      1. Login as an editing teacher and go to a course.
        • Confirm you can see the edit cog button.
      2. Switch your role to a student
        • Confirm that edit cog is not displayed.
      3. Switch back to your normal role.
        • Confirm you can see the edit cog button again.
      Learning plan templates.
      1. Login as an admin
      2. Assign a manager system role to a user.
      3. Login as the manager.
      4. Create a competency framework
      5. Add competencies to the framework
      6. Create a learning plan template and add the competencies from the framework.
      7. After creating the learning plan template, click on the "Edit" link of the learning plan template.
      8. Click "Create learning plans"
      9. Expand the "Select users to create learning plans for" dropdown menu.
        • Confirm that the dropdown menu gets populated with a list of users.
      Show
      Automated tests Run PHPUnit and Behat tests. Confirm that everything passes. Manual testing Role assignment Enrol some users on a course, give them some roles Confirm that you can assign roles Login as those users and confirm that you can login accordingly Confirm that you can rename a role within a course Confirm that you can create and assign a new role to someone. Role switching Login as an editing teacher and go to a course. Confirm you can see the edit cog button. Switch your role to a student Confirm that edit cog is not displayed. Switch back to your normal role. Confirm you can see the edit cog button again. Learning plan templates. Login as an admin Assign a manager system role to a user. Login as the manager. Create a competency framework Add competencies to the framework Create a learning plan template and add the competencies from the framework. After creating the learning plan template, click on the "Edit" link of the learning plan template. Click " Create learning plans " Expand the " Select users to create learning plans for " dropdown menu. Confirm that the dropdown menu gets populated with a list of users.

      So, for a long time accesslib has had commentary like this:
      //TODO: MUC - this could be cached in shared memory to speed up first page loading, web crawlers, etc.
      ...and lots of complexity around loading role definition information down to only courses, based on the assumption going to modules/blocks would take a large amount more memory.

      Anybody familiar with high traffic Moodle sites will also know that the login process is pretty heavy on the database, due to some of those big queries in accesslib.

      It appears sites do not really use role overrides or assignments below the course level, so it cannot use much more space to preload those extra cases.

      I've put together a proof of concept which removes the limit on how much role definition data to load, and caches this new "site wide" role definition in MUC, removing the most of the expensive portion of queries involved in initial session setup.

      Looking for some input to determine if this approach is something worth pursuing...

        1. Activity_view_5_op.pdf
          203 kB
          Rajesh Taneja
        2. Comparison without and with cache .png
          85 kB
          Rajesh Taneja
        3. comparsion_view_activities.png
          1021 kB
          Rajesh Taneja
        4. ExtraSmall(XS).png
          1.02 MB
          Rajesh Taneja
        5. Forum_post_5_op.pdf
          194 kB
          Rajesh Taneja
        6. Forum-post.png
          876 kB
          Rajesh Taneja
        7. Medium.png
          1.03 MB
          Rajesh Taneja
        8. performance-comparison.png
          79 kB
          David Monllaó
        9. prod_profile.png
          74 kB
          Tony Levi
        10. rdefcache_1vs2.png
          18 kB
          Tony Levi
        11. Screenshot from 2017-03-23 16-56-18.png
          77 kB
          Skylar Kelty
        12. sky_comparison.png
          119 kB
          Skylar Kelty
        13. Small(S).png
          1.02 MB
          Rajesh Taneja
        14. vanilla_vs_rdefcache2.png
          17 kB
          Tony Levi

            skylarkelty Skylar Kelty
            tlevi Tony Levi
            Tim Hunt Tim Hunt
            Jun Pataleta Jun Pataleta
            David Mudrák (@mudrd8mz) David Mudrák (@mudrd8mz)
            Votes:
            18 Vote for this issue
            Watchers:
            30 Start watching this issue

              Created:
              Updated:
              Resolved:

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