← Back to team overview

mahara-contributors team mailing list archive

[Bug 1450680] Re: Need better log_debug output from lib/db/upgrade.php

 

While we're at it, it would also be good to save the upgrade state after
each of those blocks as well. So that if you make it through three
blocks and fail on the fourth, you can try again and start at the
fourth.

Which I think is sort of how Moodle does it. Maybe it's time we refactor
our upgrade a little? Have a method you call at the start of each of
these blocks, that logs and updates the version number.

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1450680

Title:
  Need better log_debug output from lib/db/upgrade.php

Status in Mahara ePortfolio:
  Confirmed

Bug description:
  One of the most annoying things about db locking up during upgrade is
  you don't know where abouts in the upgrade you are - because it
  doesn't error out.

  It would be most useful if there was:

  1) At least a log_debug line at the start of every if version block -
  there are often comments there so just turn them into log_debug()
  comments.

  2) Every time we loop over a bunch of results we should have a loop counter, so upgrader knows things are still running eg:
    if ($results) {
      $count = 0;
      $limit = 1000;  // where limit is some appropriate number
      $total = count($results);
      foreach ($results as $result) {

         ... the purpose happens here ...

        $count++;
        if (($count % $limit) == 0 || $count == $total) {
            log_debug("$count/$total");
            set_time_limit(30);
        }
    }

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1450680/+subscriptions


References