Page MenuHomePhabricator

DROP unused 'slots' table (WAS: In the slots table, replace slot_inherited with slot_origin)
Closed, ResolvedPublic

Description

In order to create the slots table with the correct schema, as it is unused (will be confirmed), it is faster to drop it and then recreate it.

Dropping progress:

  • s1
  • s2
  • s3
  • s4
  • s5
  • s6
  • s7
  • s8

Apply maintenance/archives/patch-slot-origin.sql to all wiki databases (if they already have the slots table).

The patch contains the following code:
DROP INDEX /*i*/slot_role_inherited ON /*_*/slots;

ALTER TABLE /*_*/slots
DROP COLUMN slot_inherited,
ADD COLUMN slot_origin bigint unsigned NOT NULL;

CREATE INDEX /*i*/slot_revision_origin_role ON /*_*/slots (slot_revision_id, slot_origin, slot_role_id);

NOTE: the slots table is not used by production code yet, so it should be completely empty in all production databases!

Event Timeline

daniel triaged this task as Medium priority.Mar 20 2018, 2:05 PM
daniel created this task.

If we are sure it is completely empty, it might be easier and faster to drop it (if exists) and then recreate it, so you guys aren't blocked in the DBAs (as the create table can be done during a deployment by devs)

@Marostegui If that's fine with you, that's fine with me.

@Marostegui If that's fine with you, that's fine with me.

Sure, I can drop the table in core (I will check to make sure it has no data) and you can take care of creating it again with the correct schema?

Whoever deployed the table, violated the advice when creating new tables: "However, due to labs filtering limitation (hopefully, to be solved soon) you still should block on a DBA to review the table creation to check data leak is not possible." https://wikitech.wikimedia.org/wiki/Schema_changes I would like to know who and how that happened?

Whoever deployed the table, violated the advice when creating new tables: "However, due to labs filtering limitation (hopefully, to be solved soon) you still should block on a DBA to review the table creation to check data leak is not possible." https://wikitech.wikimedia.org/wiki/Schema_changes I would like to know who and how that happened?

A DBA approved the creation at T183486#3883181.

@jcrespo I had actually forgotten that we had already created these tables. But apparently you approved it: T183486#3883181

Ok, Manuel haven't communicated to me and I wasn't on that ticket. Apparently the tables were created too soon.

@Marostegui wrote:

Sure, I can drop the table in core (I will check to make sure it has no data) and you can take care of creating it again with the correct schema?

Sounds good, thank you!

@Anomie, @aude: let's wait with re-creating the table until we need it, before running the populating script in phase I.

+1 in case there are more changes

Ok, Manuel haven't communicated to me and I wasn't on that ticket. Apparently the tables were created too soon.

As far as I remember the tables were created once the patch was merged.

"too soon" in that the structure was not stable, even if it was merged.

"too soon" in that the structure was not stable, even if it was merged.

Ah right :-)

Marostegui renamed this task from In the slots table, replace slot_inherited with slot_origin to DROP unused 'slots' table (WAS: In the slots table, replace slot_inherited with slot_origin).Mar 20 2018, 2:39 PM
Marostegui updated the task description. (Show Details)

Mentioned in SAL (#wikimedia-operations) [2018-03-20T14:40:23Z] <marostegui> Drop empty (confirmed) table slots from s1 - T190153

Mentioned in SAL (#wikimedia-operations) [2018-03-20T14:42:48Z] <marostegui> Drop empty (confirmed) table slots from s2 - T190153

Mentioned in SAL (#wikimedia-operations) [2018-03-20T14:52:07Z] <marostegui> Drop empty (confirmed) table slots from s4 - T190153

Mentioned in SAL (#wikimedia-operations) [2018-03-20T14:52:53Z] <marostegui> Drop empty (confirmed) table slots from s5 - T190153

Mentioned in SAL (#wikimedia-operations) [2018-03-20T14:53:17Z] <marostegui> Drop empty (confirmed) table slots from s8 - T190153

Mentioned in SAL (#wikimedia-operations) [2018-03-20T14:55:56Z] <marostegui> Drop empty (confirmed) table slots from s6 - T190153

Mentioned in SAL (#wikimedia-operations) [2018-03-20T14:58:03Z] <marostegui> Drop empty (confirmed) table slots from s7 - T190153

Mentioned in SAL (#wikimedia-operations) [2018-03-20T15:20:46Z] <marostegui> Drop empty (confirmed) table slots from s3 - T190153

I have started the drops on s3, the last section to be done.
In order to avoid any possible delay issue I have set it with very long sleeps between drops (we have seen this causing some delays on sanitarium hosts before). It will take a few hours to get it completed. Tomorrow morning this task will be closed and you guys can proceed with the new table schema deployment at your convenience.

Marostegui moved this task from Triage to In progress on the DBA board.
Marostegui updated the task description. (Show Details)

Mentioned in SAL (#wikimedia-operations) [2018-04-20T13:35:29Z] <anomie> (re-)creating slots table on all wikis, following up T190153 and T184446#4143097