Moodle

rewrite upgrade locking

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 2.0
  • Component/s: Administration
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

At present the upgrade lock is defined in active session, this is not enough because people often close browser is the upgrade takes too long which causes a lot of problems. ALso the site should not be accessible during the upgrade.

Solution is to store the upgrade flag in config table instead.

  1. upgrade_locking_10.patch
    12/Aug/08 5:36 PM
    49 kB
    Petr Škoda (skodak)
  2. upgrade_locking_11.patch
    13/Aug/08 1:54 AM
    48 kB
    Petr Škoda (skodak)
  3. upgrade_locking_9.patch
    12/Aug/08 5:31 PM
    49 kB
    Petr Škoda (skodak)

Activity

Hide
Petr Škoda (skodak) added a comment -

please review, I would like to get this into cvs asap

Show
Petr Škoda (skodak) added a comment - please review, I would like to get this into cvs asap
Hide
Dan Poltawski added a comment -

I haven't had a chance to review the patch, but I read some chat about a locking technique used which is incompatible with NFS.

Please tread carefully with this as lots of sites with course data based on NFS!

Show
Dan Poltawski added a comment - I haven't had a chance to review the patch, but I read some chat about a locking technique used which is incompatible with NFS. Please tread carefully with this as lots of sites with course data based on NFS!
Hide
Eloy Lafuente (stronk7) added a comment -

Ah, this isn't using any filesystem locking, Dan. It's 100% DB semaphore. Just that.

I guess you hear about that when talking about new File API, and how we "lock" some files when iterating over them to be finally deleted. In that case, one flock() is used. And it really has problems under NFS.

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Ah, this isn't using any filesystem locking, Dan. It's 100% DB semaphore. Just that. I guess you hear about that when talking about new File API, and how we "lock" some files when iterating over them to be finally deleted. In that case, one flock() is used. And it really has problems under NFS. Ciao
Hide
Eloy Lafuente (stronk7) added a comment -

Some comments about the execution I've performed:

  • Big site with 150 courses and 1GB of moodledata.
  • Course files and blog files migrated ok, showing progress bars perfectly. I tried second browser and got "upgrade is running" message.
  • Got some strange feedback in assignment progress bar: "Migrated assignment submissions - 1820/1."
  • Later in the assignment upgrade, I got a lot of: Error: could not insert new context level "70", instance "XXX" and it ended with one exception: Unknown exception related to local files (Invalid contextid)
  • Immediately I opened another browser and it allowed me to run the modules upgrade. I guess the end of the script, deletes the semaphore properly, so this is correct.

So, initial tests look ok (although I haven't been able to end the process due to errors when upgrading assignments). Going to upgrade one small site now.

Ciao

Show
Eloy Lafuente (stronk7) added a comment - Some comments about the execution I've performed:
  • Big site with 150 courses and 1GB of moodledata.
  • Course files and blog files migrated ok, showing progress bars perfectly. I tried second browser and got "upgrade is running" message.
  • Got some strange feedback in assignment progress bar: "Migrated assignment submissions - 1820/1."
  • Later in the assignment upgrade, I got a lot of: Error: could not insert new context level "70", instance "XXX" and it ended with one exception: Unknown exception related to local files (Invalid contextid)
  • Immediately I opened another browser and it allowed me to run the modules upgrade. I guess the end of the script, deletes the semaphore properly, so this is correct.
So, initial tests look ok (although I haven't been able to end the process due to errors when upgrading assignments). Going to upgrade one small site now. Ciao
Hide
Eloy Lafuente (stronk7) added a comment -

Upgrading small site the upgrade ended ok. Only one notice was showed in some of the upgrade pages like:

  • messaging plugins.
  • quiz reports
  • portfolio type

The notice said:

Inccorect use of upgrade_log_start(), upgrade already logging.

  • line 893 of lib/adminlib.php: call to debugging()
  • line 320 of lib/adminlib.php: call to upgrade_log_start()
  • line 422 of admin/index.php: call to upgrade_plugins()

That's all. Ciao

Show
Eloy Lafuente (stronk7) added a comment - Upgrading small site the upgrade ended ok. Only one notice was showed in some of the upgrade pages like:
  • messaging plugins.
  • quiz reports
  • portfolio type
The notice said: Inccorect use of upgrade_log_start(), upgrade already logging.
  • line 893 of lib/adminlib.php: call to debugging()
  • line 320 of lib/adminlib.php: call to upgrade_log_start()
  • line 422 of admin/index.php: call to upgrade_plugins()
That's all. Ciao
Hide
Petr Škoda (skodak) added a comment -

committed into cvs, thanks
please reopen in case of any problems or file new issue

Show
Petr Škoda (skodak) added a comment - committed into cvs, thanks please reopen in case of any problems or file new issue

People

Dates

  • Created:
    Updated:
    Resolved: