Comments

gábor hojtsy’s picture

Status: Active » Needs work
StatusFileSize
new1.1 KB

I looked at this and decided it might be best to drop the table ASAP (right after the DB is initialized when the D7 update checks attempt to create these tables anyway). So I added code to both drop the registry and the registry_file tables, enabling for a clean refill later when the update process ends. This is not an update function but a local hack, since I did not experiment with trying to do this in the middle of the update batch process via an update function. It might be possible.

This patch works but is obviously not a good contender for inclusion with head2head.

gábor hojtsy’s picture

StatusFileSize
new1.97 KB

Let's also rebuild the registry as soon as possible (as per @pwolanin's suggestion). This is still a local hack instead of a clean head2head update. Not sure how to do that reliably at all.

gábor hojtsy’s picture

Alternatively we could of course add the hash column and compute it in an update instead of dropping and regenerating the data. I did not look deep into when the hash is used/needed, so I thought it is safest to drop and regenerate as soon a possible.

gábor hojtsy’s picture

Status: Needs work » Needs review
StatusFileSize
new2.26 KB

Ok, since the above fix turned out to not be suitable in our environment even, here is a fix which just uses an update function. The idea is similar. We just add the hash field but do not fill it in and remove the filemtime and filectime fields. Then the end of the update will fill these in with proper data (basically regenerate the whole registry due to thinking the hash missing means the file is changed). We should not compute and use the file hash, since the file might have changed inbetween the last registry update and the update.php run, so to ensure we get the best data, we pretend all files are outdated. We don't know better.

I also tried to add in the field straight with the not null and no default as defined but my MySQL thrown that up with "warning 1265 data truncated for column hash" which is ridiculous since all the cells are empty. Anyway, I tracked that down to AddField() doing a field change operation as well if the default is not specified but not null is. We can avoid that issue by changing the cell ourselves properly. This should now be up for review in head2head.

gábor hojtsy’s picture

Status: Needs review » Patch (to be ported)

Committed this myself. It worked pretty darn good in our environment with thousands of Drupal 7 sites.

gábor hojtsy’s picture

Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.