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

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


sanitarium.my.cnf: Set slave_type_conversions

For the current sanitarium this is not really mandatory, but I prefer to
add it for consistency.

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

Approvals:
  Marostegui: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/role/templates/mariadb/mysqld_config/sanitarium.my.cnf.erb 
b/modules/role/templates/mariadb/mysqld_config/sanitarium.my.cnf.erb
index 416be66..899ca24 100644
--- a/modules/role/templates/mariadb/mysqld_config/sanitarium.my.cnf.erb
+++ b/modules/role/templates/mariadb/mysqld_config/sanitarium.my.cnf.erb
@@ -41,6 +41,11 @@
 expire_logs_days               = 7
 sql-mode                       = IGNORE_BAD_TABLE_OPTIONS
 
+# 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/344586
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib41b345b8bb59c907069998ba17e6764c67f93b6
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Marostegui <maroste...@wikimedia.org>
Gerrit-Reviewer: Giuseppe Lavagetto <glavage...@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