Marostegui has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/344362 )

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

labs.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: Ida9183b38e213fe20cae8b8b5c7c2fe85ae95aad
---
M modules/role/templates/mariadb/mysqld_config/labs.my.cnf.erb
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/62/344362/1

diff --git a/modules/role/templates/mariadb/mysqld_config/labs.my.cnf.erb 
b/modules/role/templates/mariadb/mysqld_config/labs.my.cnf.erb
index 89b9aef..469ea61 100644
--- a/modules/role/templates/mariadb/mysqld_config/labs.my.cnf.erb
+++ b/modules/role/templates/mariadb/mysqld_config/labs.my.cnf.erb
@@ -53,6 +53,11 @@
 tmp_table_size                 = 64M
 max_heap_table_size            = 64M
 
+# 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/344362
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ida9183b38e213fe20cae8b8b5c7c2fe85ae95aad
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Marostegui <maroste...@wikimedia.org>

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

Reply via email to