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

Log cleanup should divide work if necessary

    XMLWordPrintable

    Details

      Description

      If you have a very large site with logs going back years, turning on the log cleanup may not work very well, as it tries to delete in a single DB query all logs up to the lifetime setting.

      I suggest changing this to work incrementally, where there is a large volume of data present. This will avoid taking one massive transaction which is likely to wreak havoc on most DBs.

      It looks like deleting one day at a time for as much as 5 minutes each run is probably a reasonable trade-off; large sites with a huge volume of old data may take, perhaps, a few weeks to "catch up" to the lifetime setting - on the other hand, it will actually complete and won't cause huge DB problems.

      Patch incoming...

        Attachments

          Activity

            People

            Assignee:
            tlevi Tony Levi
            Reporter:
            tlevi Tony Levi
            Peer reviewer:
            Dave Cooper Dave Cooper
            Integrator:
            Andrew Lyons Andrew Lyons
            Tester:
            CiBoT CiBoT
            Participants:
            Component watchers:
            Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Matteo Scaramuccia, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              11/May/15