Page MenuHomePhabricator

update.php --schema runs post-db update maintenance scripts
Open, MediumPublic

Description

When using the --schema option post-db maintenance scripts should not be run as they talk to the database directly and do not use DatabaseUpdater.

Currently if you use the Flow or WikiData extensions and pass --schema without an already initialized database it will error out since their maintenance scripts are trying to talk to an empty databse.

The use case for --schema is within jenkins to log the sql that was used within the test instance.


Version: 1.24rc
Severity: normal

Details

Reference
bz67163

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:27 AM
bzimport set Reference to bz67163.
bzimport added a subscriber: Unknown Object (MLST).

Thanks Erik, I have posted on wikitech-l:

arlier today I slightly changed how Jenkins run the MediaWiki extension job. Specifically the way the database is updated.

We used to simply:

php maintenance/update.php

I wanted to log the SQL queries behind added to the database and the script has a --schema option to do just that. So Jenkins now:

php maintenance/update.php --schema update_sql.log
sleep 1
php maintenance/update.php

The sleep is needed because --schema still write to the update_log database. The two runs ends up having the same ul_key in the table since it just vary by timestamp (so if two run occurs in the same second, the second has a duplicate key error).

There should be a better fix, but sleep 1 works ™

Flow had an issue with the tests failing because --schema still run the post-db maintenance script (might be the cause of above problem).

Erik Bernhardson figured out a temporary workaround for Flow:

https://gerrit.wikimedia.org/r/#/c/142303/

Change 142382 had a related patch set uploaded by EBernhardson:
update.php --schema should not call maint scripts

https://gerrit.wikimedia.org/r/142382

Change 142383 had a related patch set uploaded by Hashar:
Revert "Use mw-run-update-script.sh script"

https://gerrit.wikimedia.org/r/142383

Change 142383 abandoned by Hashar:
Revert "Use mw-run-update-script.sh script"

Reason:
Will hack the bin/mw-run-update-script.sh slave script instead. This way we don't have to update all the jobs in Jenkins.

https://gerrit.wikimedia.org/r/142383

Change 142386 had a related patch set uploaded by Hashar:
Skip update.php --schema for now

https://gerrit.wikimedia.org/r/142386

Change 142386 merged by jenkins-bot:
Skip update.php --schema for now

https://gerrit.wikimedia.org/r/142386

update.php --schema is now commented out. The bug in core is still valid though.

Change 142382 abandoned by EBernhardson:
update.php --schema should not call maint scripts

https://gerrit.wikimedia.org/r/142382

Change 198137 had a related patch set uploaded (by Krinkle):
Clean up mw scripts

https://gerrit.wikimedia.org/r/198137

Change 198137 merged by jenkins-bot:
Clean up mw scripts

https://gerrit.wikimedia.org/r/198137