We talked about it in the wikimania but @yuvipanda told me that due to T138450: maintain-replicas.pl unmaintained, unmaintainable we can't have it but since the blocker got resolved, I'm guessing it's okay now.
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
labs: add ores_classification and ores_model tables | operations/puppet | production | +2 -0 |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Declined | jcrespo | T150767 Wikireplica service for tools and labs - issues and missing available views (tracking) | |||
Resolved | Ladsgroup | T148561 Replicate ores_classification and ores_model tables in labs |
Event Timeline
@jcrespo, I see that this is placed in the "Blocked external/Not db team" on the DBA board. Can you clarify who you think ought to own this task?
I believe now that it is unblocked, the tables are actually replicated, so labs team or whoever maintains the views needs to enable them to be visible for users.
I am standing by in case there is some support needed about transmission from production, but I believe my part (replication itself) was done/enabled back in the day when the tables were created.
I can confirm they are in labs:
$ mysql -h labsdb1001 wikidatawiki -e "SELECT * FROM ores_classification LIMIT 10" +----------+-----------+-------------+-------------+-------------------+--------------------+ | oresc_id | oresc_rev | oresc_model | oresc_class | oresc_probability | oresc_is_predicted | +----------+-----------+-------------+-------------+-------------------+--------------------+ | 11098302 | 374419683 | 7 | 1 | 0.027 | 0 | | 11118144 | 374462067 | 7 | 1 | 0.004 | 0 | | 11118145 | 374462049 | 7 | 1 | 0.024 | 0 | | 11118146 | 374462070 | 7 | 1 | 0.161 | 0 | | 11118147 | 374462080 | 7 | 1 | 0.147 | 0 | | 11118148 | 374462090 | 7 | 1 | 0.022 | 0 | | 11118149 | 374462101 | 7 | 1 | 0.033 | 0 | | 11118150 | 374462103 | 7 | 1 | 0.007 | 0 | | 11118151 | 374462107 | 7 | 1 | 0.025 | 0 | | 11118152 | 374462087 | 7 | 1 | 0.005 | 0 | +----------+-----------+-------------+-------------+-------------------+--------------------+
Sorry I was not clear enough- the tables are replicated, but they are probably not exposed to the users yet, that is the part that someone has to figure out.
@jcrespo is right:
ladsgroup@tools-bastion-03:~$ sql fawiki "select oresm_id from ores_model limit 1;" ERROR 1146 (42S02) at line 1: Table 'fawiki_p.ores_model' doesn't exist
I think labs ops will know, but they are mostly unavailable/busy this week, so I will ask you to be patient.
@Krenair may know, but it is not something he has to do (but I think he helped with the new script).
I think what they do is patching https://phabricator.wikimedia.org/diffusion/OPUP/browse/production/modules/role/templates/labsdb/maintain-views.yaml (not 100% sure that is the right file), but amending that may speed up the process?
Change 320804 had a related patch set uploaded (by Ladsgroup):
labs: add ores_classification and ores_model tables
The code and files are different but it is the same process as with the old script. You patch the config to include the table in the (in this case) full_views list, then run the script against the affected databases (on all labsdb mysql replica servers) to have it actually create the views (along with any other changes that may have been missed by changes to the file being made without the script being run). Without this process taking place, there is little point replicating anything as no users will be able to see it.
@AlexMonk-WMF, this is not a replication or Database issue, as I just demonstrated.
Some of the subtasks you added here are not according to the description. https://phabricator.wikimedia.org/T50930#2585212 If you want to track LabsDB issues, I would kindly suggest creating a separate, specific task.
Are these https://gerrit.wikimedia.org/r/#/c/320804/2/modules/role/templates/labsdb/maintain-views.yaml views that need to be exposed in every DB or some specific DB?
Is there meant to be a table in enwiki and olowiki and on
maintain-views doesn't check that, if a database is getting public views and a defined view's source exists in that database, it should create a view. These wikis have the table(s), so will get the view(s) if replication has been set up for them:
krenair@terbium:~$ ./foreachdbs.sh "select table_schema from information_schema.tables where table_name = 'ores_classification';" enwiki nlwiki plwiki ptwiki trwiki wikidatawiki ruwiki fawiki krenair@terbium:~$ ./foreachdbs.sh "select table_schema from information_schema.tables where table_name = 'ores_model';" enwiki nlwiki plwiki ptwiki trwiki wikidatawiki ruwiki fawiki
sure, thanks, I understand. I meant something more like: is this a table to be exposed on a single wiki one-time, on these wikis one-time, on existing wiki's starting with these as X happens to add the table, or only new wiki's from here forward. The outline here is somewhat opaque, and I don't understand what the expectation is. I can certainly run maintain-views across for these DBs/tables as a one-time thing, but I don't expect to have it running as a cron until the new labsdb setup at this time.
on existing wiki's starting with these as X happens to add the table
We have 8 wikis and we're expanding. I expect to have more wikis with ores_* tables ready soon.
Alright, I think I understand then thanks. I'll take a pass at this for the existing 8 and we can treat newcomers when they pop up in a new issue. Hopefully, soon we will not have this be as manual / adhoc.
For context there are two layers to this and neither is much good without the other. The title of Replicate ores_classification and ores_model tables in labs is probably most literally construed as completed now but we manage access to the underlying tables by creating views and have a permission model around it. Something like Expose x tables to labs users via labsdb would be more inclusive. This is not a big deal at all, just a thought on why I was momentarily confused about the scope here. The replication and views specifics are definitely inside baseball. We have a big week here and I think we can get to this wednesday 11/16 or so.
--- /etc/maintain-views.yaml 2016-11-02 19:12:41.326458322 +0000 +++ /tmp/puppet-file20161116-18909-1ma54yp 2016-11-16 16:30:19.300683398 +0000 @@ -88,6 +88,8 @@ - module_deps - msg_resource_links - namespaces + - ores_classification + - ores_model - page - page_broken - pagelinks
Let me know when more DBs are ready, this is not a big deal to do though it is unfortunately a manual command.