Incorrect key file for table ‘xxx’; try to repair it

2017-04-21 01:29:34 7f1d8c0bd700 InnoDB: Error: Write to file (merge) failed at offset 2095054848.
InnoDB: 1048576 bytes should have been written, only 978944 were written.
InnoDB: Operating system error number 28.
InnoDB: Check that your OS and file system support files of this size.
InnoDB: Check also that the disk is not full or a disk quota exceeded.
InnoDB: Error number 28 means ‘No space left on device’.
InnoDB: Some operating system error numbers are described at
2017-04-21 01:29:35 93551 [ERROR] Slave SQL: Worker 7 failed executing transaction ” at master log mysql-bin.001470, end_log_pos 931467087; Error ‘Incorrect key file for table ‘xxx’; try to repair it’ on query. Default database: ‘xxx’. Query: ‘ALTER TABLE xxx ADD xxx TINYINT(3) DEFAULT ‘0’ NOT NULL’, Error_code: 1034
2017-04-21 01:29:35 93551 [Warning] Slave SQL: … The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state. A restart should restore consistency automatically, although using non-transactional storage for data or info tables or DDL queries could lead to problems. In such cases you have to examine your data (see documentation for details). Error_code: 1756

报错信息如上,日志提示空间不够,df -h 确认 MySQL datadir 所在磁盘空间是足够的。后确认是修改表定义需新建临时表,临时表目录为 my.cnf 设置中 temdir 的路径(默认为 /tmp),修改该配置后重启 MySQL 服务,问题解决。