Page MenuHomePhabricator

Drop tables with no events in last 90 days.
Closed, ResolvedPublic5 Estimated Story Points

Description

Been looking at EventLogging MySQL stuff, and we want to drop some old crufty tables.

This script: https://gist.github.com/ottomata/c7e78da9597c48f048877a8318cd4550 outputs DROP TABLE statements to drop any EventLogging table not in this whitelist and that doesn't have data in the last 90 days.

I'd run this on the master, and then on both slaves. This isn't automated purging in any way, but just gets rid of the 124 old crufty tables that should be cleaned up now.

Any objections?

Event Timeline

Ping @jcrespo and @Marostegui this is just an FYI, no action required on your part other than confirming that this is OK for us to do.

That is fine, thanks for the heads up.
Normally I like to run those statements with:

set session sql_log_bin=0 ; DROP TABLE IF EXISTS tablename;

But as replication isn't involved, it is not a big deal.
Thanks!

Nuria set the point value for this task to 5.

@Ottomata: Do we have a list of the 124 tables that were dropped? More generally, the script should log deletions if it doesn't already.

FWIW, it looks like these three are currently slated for deletion:
ChangesListFilters_15876023
ChangesListHighlights_16484288 (table is empty anyway)
CookieBlock_16046548

@Tbayer: no, every table not in whitelist whose entire data was older than 90 days was dropped.

FWIW, it looks like these three are currently slated for deletion:

Future purging might leave tables there, just empty of data, we are currently working on those changes as part of https://phabricator.wikimedia.org/T156933

@Tbayer: no, every table not in whitelist whose entire data was older than 90 days was dropped.

"No" meaning we have no remaining knowledge about which tables were dropped in particular?

Amend: Here is list of tables, now , note that running this script was a one-off, purging script is being worked on in the prior ticket:
https://gist.github.com/ottomata/df9d4615b8ffdf538faf6a005683e1fc

Thanks for the list! Agree that leaving an empty table is much preferable to dropping it without a trace.