Marostegui has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/344087 )

Change subject: sanitarium2.my.cnf: Set slave_type_conversions
......................................................................


sanitarium2.my.cnf: Set slave_type_conversions

When doing an ALTER table on hosts whose master is running ROW based
replication, and attempting to expand a column, replication can break
with:

Last_SQL_Error: Column 8 of table 'commonswiki.image' cannot be
converted from type 'varchar(32)' to type 'varbinary(100)'

To prevent this we are setting slave_type_conversion to ALL_NON_LOSSY
which would allow the transaction to go on.
The documentation states:
"This mode permits conversions that do not require truncation or other
special handling of the source value; that is, it permits conversions
where the target type has a wider range than the source type.

Setting this mode has no bearing on whether lossy conversions are
permitted; this is controlled with the ALL_LOSSY mode. If only
ALL_NON_LOSSY is set, but not ALL_LOSSY, then attempting a conversion
that would result in the loss of data (such as INT to TINYINT, or
CHAR(25) to VARCHAR(20)) causes the slave to stop with an error."

Bug: T73563
Change-Id: Iaafd150644592b6976da3054ce467b337d914f5c
---
M modules/role/templates/mariadb/mysqld_config/sanitarium2.my.cnf.erb
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Marostegui: Looks good to me, approved
  jenkins-bot: Verified
  Jcrespo: Looks good to me, but someone else must approve



diff --git 
a/modules/role/templates/mariadb/mysqld_config/sanitarium2.my.cnf.erb 
b/modules/role/templates/mariadb/mysqld_config/sanitarium2.my.cnf.erb
index e15869a..bb6317c 100644
--- a/modules/role/templates/mariadb/mysqld_config/sanitarium2.my.cnf.erb
+++ b/modules/role/templates/mariadb/mysqld_config/sanitarium2.my.cnf.erb
@@ -73,6 +73,11 @@
 # 10.1 option to allow triggers with RBR enabled
 slave_run_triggers_for_rbr = yes
 
+# Needed when using ROW based replication and altering the width of a column, 
if not set, the ALTER will fail
+# 
https://dev.mysql.com/doc/mysql-replication-excerpt/5.7/en/replication-features-different-data-types.html
+# T73563#3117924
+slave_type_conversions         = ALL_NON_LOSSY
+
 table_open_cache               = 10000
 table_definition_cache         = 50000
 open-files-limit               = 400000

-- 
To view, visit https://gerrit.wikimedia.org/r/344087
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaafd150644592b6976da3054ce467b337d914f5c
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Marostegui <maroste...@wikimedia.org>
Gerrit-Reviewer: Giuseppe Lavagetto <glavage...@wikimedia.org>
Gerrit-Reviewer: Jcrespo <jcre...@wikimedia.org>
Gerrit-Reviewer: Marostegui <maroste...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to