Page MenuHomePhabricator

Drop wb_changes_dispatch table in production
Closed, ResolvedPublic


Context: T291829: Drop wb_changes_dispatch table; the table was used in the old change dispatching system, which we no longer use. (You can see that the chd_touched column is frozen in time, not updated since 2021-10-04.)

  1. ALTERs to run: DROP TABLE wb_changes_dispatch;
    • or maybe something like RENAME TABLE wb_changes_dispatch TO T294121_DROP_wb_changes_dispatch; wait for a bit to ensure that nothing is trying to use the table; then DROP TABLE T294121_DROP_wb_changes_dispatch – if you want to be extra safe
  2. Where to run those changes: wikibaserepo.dblist
    • commonswiki
    • testcommonswiki
    • testwikidatawiki
    • wikidatawiki
  3. When to run those changes: At any time
  4. If the schema change is backwards compatible: Yes
  5. If the schema change has been tested already on some of the test/beta wikis: Yes, dropped via update.php in Beta

Event Timeline

Marostegui triaged this task as Medium priority.Oct 22 2021, 1:56 PM
Marostegui moved this task from Triage to Ready on the DBA board.
Marostegui subscribed.

This is not a Schema-change-in-production or Schema-change so removing this tag. We use those tags for changes on the schema of our tables and this is a drop.
We'll rename the table first indeed, that's our usual procedure to make double sure nothing reads/writes
I assume this is ready to go anytime then?

Ah, damn, I skipped straight past that part 🤦

@Michael suggested waiting until the change to drop the table has been deployed to production (next week’s train), as an added precaution. But otherwise this should be ready to go, I think.

Sure, we can wait, no rush!

@Lucas_Werkmeister_WMDE was this released past week? Can this be done anytime now?

The .ibd file hasn't been touched for a month now:

ladsgroup@db1104:/srv/sqldata/wikidatawiki$ ls -l | grep -i wb_changes_dis
-rw-rw---- 1 mysql mysql         2188 Feb  8  2021 wb_changes_dispatch.frm
-rw-rw---- 1 mysql mysql     14680064 Oct  4 16:28 wb_changes_dispatch.ibd

I go rename it in a replica.

Mentioned in SAL (#wikimedia-operations) [2021-11-03T18:08:32Z] <Amir1> ran set session sql_log_bin=0; RENAME TABLE wb_changes_dispatch TO T294121_DROP_wb_changes_dispatch; on db1111 (T294121)

I renamed the table in db1111 (one of replicas). We wait a couple of days and then drop the whole thing.

Given how small the table is I would suggest to take a quick mysqldump before dropping it (I can help with that!)

root@cumin1001:/home/ladsgroup/T291829# ls -lh
total 64K
-rw-r--r-- 1 root root 2.3K Nov  4 12:07 commonswiki_wb_changes_dispatch.sql
-rw-r--r-- 1 root root 2.3K Nov  4 12:07 testcommonswiki_wb_changes_dispatch.sql
-rw-r--r-- 1 root root 2.7K Nov  4 12:06 testwikidatawiki_wb_changes_dispatch.sql
-rw-r--r-- 1 root root  50K Nov  4 12:05 wikidatawiki_wb_changes_dispatch.sql

If there are no errors on logstash in the last few days - we can probably go ahead and delete this in production.
The tables are small enough that it can be done thru replication but always using DROP TABLE IF EXISTS

I looked in logstash and I don't see any errors. It's still not written anything yet. Moving forward to dropping it.

Ladsgroup moved this task from In progress to Done on the DBA board.

@Ladsgroup remember to also delete (if you haven't already) the renamed tables on db1111.

@Ladsgroup remember to also delete (if you haven't already) the renamed tables on db1111.

I renamed it back first and then let it ran on master with replication. The Lazy Way.

Good! Then good to close I think!