Page MenuHomePhabricator

Drop Semantic Database tables from wikitech wikis
Closed, ResolvedPublic

Description

As a matter of good practice... We should drop the various Semantic tables from wikitech and labtestwikitech

smw_concept_cache
smw_di_blob
smw_di_bool
smw_di_coords
smw_di_number
smw_di_time
smw_di_uri
smw_di_wikipage
smw_fpt_ask
smw_fpt_askde
smw_fpt_askfo
smw_fpt_asksi
smw_fpt_askst
smw_fpt_cdat
smw_fpt_conc
smw_fpt_conv
smw_fpt_impo
smw_fpt_inst
smw_fpt_ledt
smw_fpt_list
smw_fpt_mdat
smw_fpt_newp
smw_fpt_pval
smw_fpt_redi
smw_fpt_serv
smw_fpt_sf_af
smw_fpt_sf_df
smw_fpt_sobj
smw_fpt_subc
smw_fpt_subp
smw_fpt_type
smw_fpt_unit
smw_fpt_uri
smw_object_ids
smw_prop_stats

Event Timeline

Reedy created this task.May 9 2017, 10:23 PM
Restricted Application added a project: Cloud-Services. · View Herald TranscriptMay 9 2017, 10:23 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
demon updated the task description. (Show Details)May 9 2017, 10:25 PM
Marostegui moved this task from Triage to Backlog on the DBA board.May 10 2017, 6:23 AM
Reedy moved this task from Unsorted to Delete / Drop / Remove on the Schema-change board.

Mentioned in SAL (#wikimedia-operations) [2017-05-12T08:58:43Z] <marostegui> Rename semantic tables before dropping them on wikitech hosts (silver and labtestweb2001) - T164887

I have renamed the tables for now on silver and labtestweb2001.
So they now look like:

root@silver:~# mysql --skip-ssl labswiki -e "show tables like 'T164887%';"
+-------------------------------+
| Tables_in_labswiki (T164887%) |
+-------------------------------+
| T164887_smw_concept_cache     |
| T164887_smw_di_blob           |
| T164887_smw_di_bool           |
| T164887_smw_di_coords         |
| T164887_smw_di_number         |
| T164887_smw_di_time           |
| T164887_smw_di_uri            |
| T164887_smw_di_wikipage       |
| T164887_smw_fpt_ask           |
| T164887_smw_fpt_askde         |
| T164887_smw_fpt_askfo         |
| T164887_smw_fpt_asksi         |
| T164887_smw_fpt_askst         |
| T164887_smw_fpt_cdat          |
| T164887_smw_fpt_conc          |
| T164887_smw_fpt_conv          |
| T164887_smw_fpt_impo          |
| T164887_smw_fpt_inst          |
| T164887_smw_fpt_ledt          |
| T164887_smw_fpt_list          |
| T164887_smw_fpt_mdat          |
| T164887_smw_fpt_newp          |
| T164887_smw_fpt_pval          |
| T164887_smw_fpt_redi          |
| T164887_smw_fpt_serv          |
| T164887_smw_fpt_sf_af         |
| T164887_smw_fpt_sf_df         |
| T164887_smw_fpt_sobj          |
| T164887_smw_fpt_subc          |
| T164887_smw_fpt_subp          |
| T164887_smw_fpt_type          |
| T164887_smw_fpt_unit          |
| T164887_smw_fpt_uri           |
| T164887_smw_object_ids        |
| T164887_smw_prop_stats        |
+-------------------------------+


root@labtestweb2001:~# mysql --skip-ssl labtestwiki -e "show tables like 'T164887%';"
+----------------------------------+
| Tables_in_labtestwiki (T164887%) |
+----------------------------------+
| T164887_smw_concept_cache        |
| T164887_smw_di_blob              |
| T164887_smw_di_bool              |
| T164887_smw_di_coords            |
| T164887_smw_di_number            |
| T164887_smw_di_time              |
| T164887_smw_di_uri               |
| T164887_smw_di_wikipage          |
| T164887_smw_fpt_ask              |
| T164887_smw_fpt_askde            |
| T164887_smw_fpt_askfo            |
| T164887_smw_fpt_asksi            |
| T164887_smw_fpt_askst            |
| T164887_smw_fpt_cdat             |
| T164887_smw_fpt_conc             |
| T164887_smw_fpt_conv             |
| T164887_smw_fpt_impo             |
| T164887_smw_fpt_inst             |
| T164887_smw_fpt_ledt             |
| T164887_smw_fpt_list             |
| T164887_smw_fpt_mdat             |
| T164887_smw_fpt_newp             |
| T164887_smw_fpt_pval             |
| T164887_smw_fpt_redi             |
| T164887_smw_fpt_serv             |
| T164887_smw_fpt_sf_af            |
| T164887_smw_fpt_sf_df            |
| T164887_smw_fpt_sobj             |
| T164887_smw_fpt_subc             |
| T164887_smw_fpt_subp             |
| T164887_smw_fpt_type             |
| T164887_smw_fpt_unit             |
| T164887_smw_fpt_uri              |
| T164887_smw_object_ids           |
| T164887_smw_prop_stats           |
+----------------------------------+

To revert this change:

silver: cat /root/revert_rename_T164887 | mysql --skip-ssl labswiki
labtestweb2001: cat /root/revert_rename_T164887 | mysql --skip-ssl labtestwiki
Marostegui moved this task from Backlog to In progress on the DBA board.May 12 2017, 9:05 AM

I have backup'ed the tables by the way:

dbstore1001:/srv/tmp/silver_labswiki_T164887.tar.gz
dbstore1001:/srv/tmp/labtestweb2001_labtestwiki_T164887.tar.gz

Mentioned in SAL (#wikimedia-operations) [2017-05-17T06:54:29Z] <marostegui> Drop already renamed tables from silver (labswiki) - T164887

Mentioned in SAL (#wikimedia-operations) [2017-05-17T06:56:10Z] <marostegui> Drop already renamed tables from labtestweb2001 (labtestwiki) - T164887

Marostegui closed this task as Resolved.May 17 2017, 6:58 AM
Marostegui claimed this task.

Tables dropped.
This is what has been run:

root@silver:~# for i in `mysql --skip-ssl labswiki -e "show tables like 'T164887%';" -BN`; do echo $i; mysql --skip-ssl labswiki -e "DROP TABLE IF EXISTS $i";done

root@labtestweb2001:~# for i in `mysql --skip-ssl labtestwiki -e "show tables like 'T164887%';" -BN`; do echo $i; mysql --skip-ssl labtestwiki -e "DROP TABLE IF EXISTS $i;";done

Reminder of the table backups in case we need them :

dbstore1001:/srv/tmp/silver_labswiki_T164887.tar.gz
dbstore1001:/srv/tmp/labtestweb2001_labtestwiki_T164887.tar.gz