Last modified: 2012-08-07 01:41:27 UTC
The upgrade script for MySQL (includes/installer/MysqlUpgrade.php) provided with MediaWiki 1.19.1 is missing the addtable for %{prefix}msg_resource_links. This makes that an upgraded database trips over the large number of REPLACE INTO's for %{prefix}msg_resource. This addtable statement IS available in the upgrade scripts for IBM DB2 and Oracle.
Created attachment 10935 [details] This patch fixes the problem
Pushed you patch into Gerrit: https://gerrit.wikimedia.org/r/#/c/17687/
Per comments on gerrit, those additions are files for DB2, not for mysql
patch-msg_resource.sql was added in 1.17 Contents: -- Table for storing JSON message blobs for the resource loader CREATE TABLE /*_*/msg_resource ( -- Resource name mr_resource varbinary(255) NOT NULL, -- Language code mr_lang varbinary(32) NOT NULL, -- JSON blob. This is an incomplete JSON object, i.e. without the wrapping {} mr_blob mediumblob NOT NULL, -- Timestamp of last update mr_timestamp binary(14) NOT NULL ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/mr_resource_lang ON /*_*/msg_resource(mr_resource, mr_lang); -- Table for administering which message is contained in which resource CREATE TABLE /*_*/msg_resource_links ( mrl_resource varbinary(255) NOT NULL, -- Message key mrl_message varbinary(255) NOT NULL ) /*$wgDBTableOptions*/; CREATE UNIQUE INDEX /*i*/mrl_message_resource ON /*_*/msg_resource_links (mrl_message, mrl_resource); https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=includes/installer/MysqlUpdater.php;h=9e7869ecb51c906deaedf3359a940495f2ace18a;hb=d0c0aabb3c5d40688d2435c0963927da479a47e0 Line 171 array( 'addTable', 'msg_resource', 'patch-msg_resource.sql' ), Did you run the updater?
Yes, we did run the updater. msg_resource was created, but apparently the whole problem is that the constraint over this table is NOT added. This makes it trip because the REPLACE INTO msg_resource will just add a new row instead of replacing the old one. We have ran into this issue at two different installations, both where missing this constraint. We found this out because today it restarted tripping again, because the cache had expired.
When looking again, the constraint should have been added by the sql script. I think there have been some issues with the upgrade process.
(In reply to comment #5) > Yes, we did run the updater. > msg_resource was created, but apparently the whole problem is that the > constraint over this table is NOT added. > > This makes it trip because the REPLACE INTO msg_resource will just add a new > row instead of replacing the old one. > We have ran into this issue at two different installations, both where missing > this constraint. > > We found this out because today it restarted tripping again, because the cache > had expired. Which constraint?
msg_resource_language, the one constraint on msg_resource.