Request for DBA review of https://gerrit.wikimedia.org/r/#/c/256385/ and creating the table for CX Parallel corpora.
|Resolved||santhosh||T95886 for ContentTranslation MT, store information about source content, machine-translated content and user-edited content|
|Resolved||santhosh||T111905 Design the technical infrastructure for parallel corpora storage and api (tracking)|
|Resolved||santhosh||T119617 Create new table for CX Parallel corpora|
|Resolved||None||T120815 Review and create CX Parallel corpora table|
@jcrespo We have addressed your comment about the schema(added primary key). We would like to get the table created by next tuesday(next train schedule).
To avoid issues to user we are turning it off this feature using a configuration and plans to enable as soon as table is created.
@jcrespo, you had reviewed the patch in December and we addressed your comments. What is pending is creating the tables.
You do not need me to create new tables, that is not a schema change and is not dangerous. See: https://wikitech.wikimedia.org/wiki/Schema_changes#What_is_not_a_schema_change I had already agreed with the table structure.
@jcrespo, Thanks for updates.
- Who can create tables? Anyone from Ops team can help?
- Is there any documentation on creating tables on Wikitech?
Jaime has agreed on the table schema and adding a new table is not a schema change. Ie it is not being handled by DBA since it is low risk. Though the wiki page states a table creation on all DB should be notified to dba.
Then how do we create a new table? Almost as you would do on a normal wiki / developer instance. Use MediaWiki maintenance/sql.php to source the .sql patch file that deals with the table creation. The process is documented on wikitech - how to do a schema change:
mwscript sql.php --wiki=testwiki extensions/ContentTranslation/sql/parallel-corpora.sql
Might be tested on the Beta-Cluster-Infrastructure , though there update.php is run continuously. So to do the test you would have to drop the table first or run the sql.php against a wiki database that does not have the table.
Do not ever run update.php on production wiki.
Feel free to poke Release-Engineering-Team about it on IRC #wikimedia-releng or poke regular SWAT deployers which should be familiar with sql.php usage.
(to clarify: I am not going to handle the table creation but we can offer support / training :D )
The table belongs to the shared wikishared or extension1 (IIRC they have different names in production and beta labs) database, not to the database of any particular wiki. As far as I can see sql.php does not support this.
Maybe I can modify sql.php to allow this on a separate issue? It works for wiki creation, so I think it should be included here, too.
Indeed MediaWiki maintenance/sql.php relies on a $wgDBName. So instead you can use the mysql client wrapper which connect you directly to any arbitrary database name as an admin. The wrapper grab the user/pass by asking it from MediaWiki PrivateSettings.php
tin$ which sql /usr/local/bin/sql tin$ sql wikishared mysql:wgDBUser@10.0.0.y [wikishared]>
That sql commands is the raw mysql client. It will not expand the MediaWiki magic comments such as /* _ */ or /*$wgDBTableOptions*/. So you will want to double check them and might have to create a suitable .sql file.
Then it should be:
tin$ sql wikishared mysql:wgDBUser@10.0.0.y [wikishared]> source whatever.sql // output of table creation
Oh, so no need to change it. @santhosh, follow Krenair's advice. Let me know if you need help (I knew I didn't know much about mediawiki's scripts, that why I requested help).