Mattflaschen has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/369586 )
Change subject: Remove externalstore role; instead use only for wikimediaflow
......................................................................
Remove externalstore role; instead use only for wikimediaflow
Before there was an externalstore role, which both defined the ES
setup and used it for all core pages. Then, wikimediaflow depended
on that role.
This caused problems with some multi-wiki setups (T161190).
-----
Instead, there is now an externalstore module that is not directly
accessible. wikimediaflow now imports this.
If you are using wikimediaflow, you shouldn't notice any difference.
If you previously used the externalstore role directly (and don't use
wikimediaflow), your core pages will stop working. You can work around
this by adding:
require ::externalstore
under the "class role" line of the puppet/modules/role/manifests/ of
any role you have enabled.
If you still see the error, do action=purge.
(Or, destroy your VM.)
Bug: T136969
Bug: T161190
Change-Id: Ifaaad90028dcc50c9555c2e8a12140106a186c2f
---
M puppet/hieradata/common.yaml
R puppet/modules/externalstore/manifests/init.pp
R puppet/modules/externalstore/templates/conf.php.erb
M puppet/modules/role/manifests/wikimediaflow.pp
4 files changed, 28 insertions(+), 16 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant
refs/changes/86/369586/1
diff --git a/puppet/hieradata/common.yaml b/puppet/hieradata/common.yaml
index 69289d3..cbbe5e4 100644
--- a/puppet/hieradata/common.yaml
+++ b/puppet/hieradata/common.yaml
@@ -72,6 +72,12 @@
crm::tools::dir: "%{hiera('mwv::services_dir')}/fundraising-tools"
+externalstore::grant_db_host: "%{hiera('mysql::grant_host_name')}"
+externalstore::db_host: "%{hiera('mediawiki::multiwiki::db_host')}"
+externalstore::db_user: "%{hiera('mediawiki::multiwiki::db_user')}"
+externalstore::db_pass: "%{hiera('mediawiki::multiwiki::db_pass')}"
+externalstore::db_name: 'external'
+
hhvm::common_settings:
date:
timezone: UTC
@@ -332,12 +338,6 @@
role::echo::echo_dir: "%{hiera('mediawiki::dir')}/extensions/Echo"
role::elk::vhost_name: "logstash%{hiera('mwv::tld')}"
-
-role::externalstore::grant_db_host: "%{hiera('mysql::grant_host_name')}"
-role::externalstore::db_host: "%{hiera('mediawiki::multiwiki::db_host')}"
-role::externalstore::db_user: "%{hiera('mediawiki::multiwiki::db_user')}"
-role::externalstore::db_pass: "%{hiera('mediawiki::multiwiki::db_pass')}"
-role::externalstore::db_name: 'external'
payments::branch: fundraising/REL1_27
payments::dir: /vagrant/mediawiki-fr
diff --git a/puppet/modules/role/manifests/externalstore.pp
b/puppet/modules/externalstore/manifests/init.pp
similarity index 64%
rename from puppet/modules/role/manifests/externalstore.pp
rename to puppet/modules/externalstore/manifests/init.pp
index c37168f..16560ed 100644
--- a/puppet/modules/role/manifests/externalstore.pp
+++ b/puppet/modules/externalstore/manifests/init.pp
@@ -1,11 +1,15 @@
-# == Class: role::externalstore
+# == Class: externalstore
# ExternalStore is a system that allows MediaWiki (and optionally
# extensions) to store content in a separate database, rather than
-# the text table
+# the text table.
#
-# If you disable this role, you will not be able to access content
-# that was saved when it was active.
-class role::externalstore (
+# If you (indirectly, via a role that was using it) disable this
+# module, you will not be able to access content that was saved when
+# it was active.
+#
+# This only defines the separate database; it doesn't use it for
+# anything. Roles and other modules can import it.
+class externalstore (
$grant_db_host,
$db_host,
$db_name,
@@ -15,7 +19,7 @@
include ::mediawiki
mysql::db { 'external store db':
- dbname => 'external',
+ dbname => $db_name,
}
mysql::sql { "GRANT ALL PRIVILEGES ON ${db_name}.* TO
${db_user}@${grant_db_host}":
@@ -30,6 +34,9 @@
}
mediawiki::settings { 'external store settings':
- values => template('role/externalstore/conf.php.erb'),
+ values => template('externalstore/conf.php.erb'),
}
+
+ # External Store defined above, to reference in other modules
+ $main_store = "array( 'DB://${db_name}' )"
}
diff --git a/puppet/modules/role/templates/externalstore/conf.php.erb
b/puppet/modules/externalstore/templates/conf.php.erb
similarity index 64%
rename from puppet/modules/role/templates/externalstore/conf.php.erb
rename to puppet/modules/externalstore/templates/conf.php.erb
index 7fa8a2c..7a730f6 100644
--- a/puppet/modules/role/templates/externalstore/conf.php.erb
+++ b/puppet/modules/externalstore/templates/conf.php.erb
@@ -1,3 +1,8 @@
+// This is good enough for Flow, but causes
+// issues with cross-wiki scenarios like
+// T161190. So it shouldn't be used for
+// core pages (wgDefaultExternalStore) until
+// that's resolved.
$wgExternalServers['external'] = array(
array(
'host' => '<%= @db_host %>',
@@ -11,4 +16,3 @@
);
$wgExternalStores = array( 'DB' );
-$wgDefaultExternalStore = array( 'DB://external' ); // =
$wgExternalServers['external']
diff --git a/puppet/modules/role/manifests/wikimediaflow.pp
b/puppet/modules/role/manifests/wikimediaflow.pp
index e5d0d5a..a61a658 100644
--- a/puppet/modules/role/manifests/wikimediaflow.pp
+++ b/puppet/modules/role/manifests/wikimediaflow.pp
@@ -2,6 +2,8 @@
# Flow with a closer configuration to production
# Depends on role::flow
class role::wikimediaflow {
+ require ::externalstore
+
require ::role::flow
include ::role::antispam
@@ -9,7 +11,6 @@
include ::role::cldr
include ::role::confirmedit
include ::role::eventlogging
- include ::role::externalstore
include ::role::betafeatures
include ::role::varnish
include ::role::visualeditor
@@ -36,7 +37,7 @@
mediawiki::settings { 'Wikimedia Flow':
values => [
'$wgDefaultUserOptions[\'flow-editor\'] = \'visualeditor\';',
- '$wgFlowExternalStore = $wgDefaultExternalStore;',
+ "\$wgFlowExternalStore = ${$::externalstore::main_store};",
],
priority => 25, # Load after Flow extension
}
--
To view, visit https://gerrit.wikimedia.org/r/369586
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifaaad90028dcc50c9555c2e8a12140106a186c2f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits