Page MenuHomePhabricator

Use dedicated $wgFlowCluster and $wgFlowDefaultWikiDb in MediaWiki-Vagrant
Closed, ResolvedPublic

Description

Use the Flow/extension cluster and flowdb.

This will make sure code is getting their database connections correctly. We hit a bug in this with T115695: Add Flow support to Nuke.

I'm going to use the same MySQL instance (for simplicity and perf), but to fully isolate it, I'll use different wgExternalServer, usernames and passwords. That's why this is blocked on T86373: MediaWiki should not connect as root database user on MediaWiki-Vagrant (so if you connect on the app code, you can't jump to the extension cluster).


Options:

  1. Stop supporting update.php for Flow on MediaWiki-Vagrant? You would just run it manually like we do in production.
  2. Keep supporting update.php, but require trivial post-DB maintenance scripts to be written when it was previously just a SQL file added in Hooks.php.

Event Timeline

Mattflaschen-WMF updated the task description. (Show Details)
Mattflaschen-WMF raised the priority of this task from to High.
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Mattflaschen-WMF set Security to None.

AFAICT, this would break update.php done naively, since that expects to use the main database. I brought up three possibilities on IRC:

[12/18/15 20:46] <matt_flaschen> 1. Stop supporting update.php for Flow on MediaWiki-Vagrant? You would just run it manually like we do in production.
[12/18/15 20:47] <matt_flaschen> 2. Keep supporting update.php, but require trivial post-DB maintenance scripts to be written when it was previously just a SQL file added in Hooks.php.
[12/18/15 20:48] <matt_flaschen> 3. Drop https://phabricator.wikimedia.org/T121827 and risk another problem like the Nuke one.

Roan and I had a quick chat about them. I'm going to try #2, and put it up for discussion/review. It adds some boilerplate, but it shouldn't be too complicated, and update.php will still work (unlike other similar extensions, like CentralAuth)

This did cause T115695: Add Flow support to Nuke (well, the different testing environment meant it was not caught), but it's also going to be a fair amount of work. Is it a priority for us?

We've started discussing doing this again, due to bugs that can only be reproduced in production.

Mattflaschen-WMF renamed this task from Use custom $wgFlowCluster and $wgFlowDefaultWikiDb in MediaWiki-Vagrant to Use dedicated $wgFlowCluster and $wgFlowDefaultWikiDb in MediaWiki-Vagrant.Oct 5 2016, 10:13 PM
Mattflaschen-WMF updated the task description. (Show Details)

Change 406600 had a related patch set uploaded (by Sbisson; owner: Sbisson):
[mediawiki/vagrant@master] Put Flow in its own DB

https://gerrit.wikimedia.org/r/406600

Restricted Application added a project: Growth-Team. · View Herald TranscriptSep 12 2018, 6:42 PM
kostajh moved this task from Inbox to Current Sprint on the Growth-Team board.Sep 26 2018, 1:48 PM
kostajh edited projects, added Growth-Team (Current Sprint); removed Growth-Team.

Change 406600 merged by jenkins-bot:
[mediawiki/vagrant@master] Put Flow in its own DB

https://gerrit.wikimedia.org/r/406600

kostajh added a subscriber: kostajh.

I've tested this locally.

Note that initial vagrant up will throw an error (see comments here) but vagrant provision afterwards will work.

@kostajh I've enabled mediawikiflow and flow roles. Logged in to local env and enable Flow on a user talk page. The flow tables were created in enwiki db. The user talk page displays the following error:

@kostajh I've enabled mediawikiflow and flow roles. Logged in to local env and enable Flow on a user talk page. The flow tables were created in enwiki db. The user talk page displays the following error:

This is caused by a permission issue on your shared folder, it's not related to the Flow tables.

Running something like that would probably fix it: chmod 777 /vagrant/mediawiki/extensions/Flow/handlebars/compiled/*

@Etonkovidova I've worked around this by setting $wgFlowServerCompileTemplates = false; in my LocalSettings.php. I've always had to do that, even before this patch.

Something like this in flow.pp might work too:

file { '/vagrant/mediawiki/extensions/Flow/handlebars/compiled':
      ensure  => directory,
      mode    => '0777',
    }

I can try to test that out later.

Etonkovidova closed this task as Resolved.Oct 6 2018, 12:11 AM

Thanks, @SBisson's suggestion works - all seem to be in place. flowdb is present with all tables.