Bug #84996 Noisy InnoDB warnings maybe should not be there (or filterable)
Submitted: 14 Feb 2017 14:49 Modified: 16 Feb 2017 9:12
Reporter: Simon Mudd (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.7.17 OS:Any
Assigned to: CPU Architecture:Any
Tags: index leaf page, innodb, logging, noise, replication

[14 Feb 2017 14:49] Simon Mudd
Description:
While compressing some tables I notice a log message of the following:

2017-02-06T13:00:33.130844Z 13976250 [ERROR] InnoDB: Cannot add field `some_column2` in table `some_table_20170206140024_11033`.`#sql-ib656527-921803053` because after adding it, the row size is 713 which is greater than maximum allowed size (710) for a record on index leaf page.
2017-02-06T13:00:59.168483Z 13976427 [ERROR] InnoDB: Cannot add field `some_column2` in table `some_table_20170206140024_11033`.`#sql-ib656533-921803060` because after adding it, the row size is 712 which is greater than maximum allowed size (712) for a record on index leaf page.
2017-02-06T13:01:59.459992Z 13976647 [ERROR] InnoDB: Cannot add field `some_column2` in table `some_table_20170206140024_11033`.`#sql-ib656539-921803067` because after adding it, the row size is 713 which is greater than maximum allowed size (710) for a record on index leaf page.
2017-02-06T13:03:02.435039Z 13976969 [ERROR] InnoDB: Cannot add field `some_column2` in table `some_table_20170206140024_11033`.`#sql-ib656550-921803080` because after adding it, the row size is 714 which is greater than maximum allowed size (710) for a record on index leaf page.
2017-02-06T13:03:13.650119Z 13977060 [ERROR] InnoDB: Cannot add field `some_column` in table `some_table_20170206140024_11033`.`#sql-ib656556-921803087` because after adding it, the row size is 716 which is greater than maximum allowed size (716) for a record on index leaf page.
2017-02-06T13:03:47.048045Z 13977224 [ERROR] InnoDB: Cannot add field `light_pageviews_sq` in table `some_table_20170206140024_11033`.`#sql-ib656567-921803100` because after adding it, the row size is 707 which is greater than maximum allowed size (706) for a record on index leaf page.
2017-02-06T13:04:17.692321Z 13977512 [ERROR] InnoDB: Cannot add field `some_column2` in table `some_table_20170206140406_11033`.`#sql-ib656591-921803131` because after adding it, the row size is 713 which is greater than maximum allowed size (710) for a record on index leaf page.
2017-02-06T13:05:34.036442Z 13977855 [ERROR] InnoDB: Cannot add field `some_column2` in table `some_table_20170206140406_11033`.`#sql-ib656597-921803138` because after adding it, the row size is 712 which is greater than maximum allowed size (712) for a record on index leaf page.
2017-02-06T13:07:20.659756Z 13978229 [ERROR] InnoDB: Cannot add field `some_column2` in table `some_table_20170206140406_11033`.`#sql-ib656603-921803145` because after adding it, the row size is 713 which is greater than maximum allowed size (710) for a record on index leaf page.

This can get quite noisy.

How to repeat:
This was triggered by a colleague who was compressing some tables.

Suggested fix:
I'm not sure if these messages should be logged or should go as a "warning" to the client.
They are marked as an error but I believe that nothing actually "broke" so perhaps they should be a warnings.

If these warnings can be written frequently then I wonder if they should only optionally go to the log file as similar "warnings" like unsafe statements in replication have also caused issues.

I can grab more details if needed but it looks to me like:
(1) the error severity should be checked. Is this really an error or maybe just a warning?
(2) maybe this should only go to the SQL client?
(3) maybe we should have a counter to indicate such "events"
(4) maybe it should be possible to filter out such messages from the log file.
[16 Feb 2017 9:12] MySQL Verification Team
Verified with testcase
--------------------------
drop table if exists t;
create table t(a char (217) not null)
engine=innodb row_format=compact default charset latin1;
alter table t add column b char (255) not null ;
alter table t add column c varchar (255) ;
alter table t add column d char (255) not null ;
alter table t add column e longtext ;
alter table t add column f char (255) ;
alter table t add column g longtext ;
alter table t add column h tinytext ;
alter table t add column i char (255) ;
alter table t add primary key  (c(185),b(185),i(185),h(185)) ;
alter table t row_format=compressed key_block_size=2;

Last statement fails with:
---------------------------
ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs

Error log contains:
-------------------
[ERROR] InnoDB: Cannot add field `f` in table `test`.`#sql-ib81648-3984889288` because after adding it, the row size is 1963 which is greater than maximum allowed size (1898) for a record on index leaf page.

Allowing users to add significant spam to the error log is probably a bad idea.
[16 Feb 2017 16:56] Jean-François Gagné
Probably duplicate of Bug#84439.