Update to 6.x needs batch mode
Heine - January 26, 2009 - 16:54
| Project: | Comment Upload |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
| Issue tags: | 6.x-1.0 blocker |
Description
When a site (say Drupal.org) has lots of comments, updating might not complete in 30 s. comment_upload_update_6000 needs a batch mode.

#1
Here is a first crack at implementing a batch upgrade path to go from D5 to D6. I have not yet tested it on a large site but it seems to work on a small, local test website. I'll have a fresh look at it in a couple of hours -- in the mean time, feel free to do a quick review or do do some testing.
#2
#3
Looks good except for the potential notice on
$_SESSION['comment_upload_update_6000']++. Is there a reason for the count, or could we simply use this as a flag?#4
Run on a drupal.org database dump on a beefy server seems to be not affected by any timeout. However, it does not guarantee that the run on drupal.org will not get timed out.
#5
The updated code uses two "select into" queries for speed rather than looping if db = mysql. Setting back to active so I remember to patch for non-mysql databases.
#6
Since drupal.org uses MySQL and this has good performance on MySQL, it works for us.
#7
I found http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/comment_upl..., apparently slipped in with another commit (?).
Needs a rollback, as this FUBARed the files table of do.
if (substr($db_url, 0, 5) == 'mysql') {David Strauss:
Doesn't work when $db_url is an array. ($db_type should be used).
autoincrement is not consistent between table engines; the INSERT INTO .. SELECT has to go.
#8
This should get cleaned up and resolved before a 6.x-1.0 release.