InnoDB: Failing assertion: format != 0

本文涉及的产品
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS PostgreSQL,集群系列 2核4GB
简介: InnoDB: Failing assertion: format != 0

1、MySQL版本5.7.19,OS是MAC OSX在删除表空间时,出现如下错误

[root@localhost][(none)]> drop tablespace ts1;
ERROR 2013 (HY000): Lost connection to MySQL server during query

2、查看error.log日志,看样子有点像是BUG

2018-04-09 16:00:21 0x700007f04000  InnoDB: Assertion failure in thread 123145435496448 in file ha_innodb.cc line 20927
InnoDB: Failing assertion: format != 0
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
08:00:21 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.

key_buffer_size=8388608
read_buffer_size=16777216
max_used_connections=1
max_threads=512
thread_count=2
connection_count=1
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 25180932 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x7f86b59eda00
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 700007f03e90 thread_stack 0x40000
0   mysqld                              0x000000010385b12a my_print_stacktrace + 58
1   mysqld                              0x00000001037b7e30 handle_fatal_signal + 688
2   libsystem_platform.dylib            0x00007fff7ab81f5a _sigtramp + 26
3   mysqld                              0x0000000104175c4b _ZZN10binary_log4Uuid9to_stringEPKhPcE11byte_to_hex + 78811
4   libsystem_c.dylib                   0x00007fff7a9ac312 abort + 127
5   mysqld                              0x0000000103ab1471 _Z23ut_dbg_assertion_failedPKcS0_m + 161
6   mysqld                              0x0000000103970147 _Z11ib_senderrfP3THD14ib_log_level_tjz + 359
7   mysqld                              0x0000000103982b27 _Z7ib_errfP3THD14ib_log_level_tjPKcz + 199
8   mysqld                              0x0000000103984f9c _ZL25innobase_alter_tablespaceP10handlertonP3THDP19st_alter_tablespace + 1260
9   mysqld                              0x00000001037353e4 _Z22mysql_alter_tablespaceP3THDP19st_alter_tablespace + 228
10  mysqld                              0x00000001036c6920 _Z21mysql_execute_commandP3THDb + 12816
11  mysqld                              0x00000001036c2d28 _Z11mysql_parseP3THDP12Parser_state + 872
12  mysqld                              0x00000001036c1b98 _Z16dispatch_commandP3THDPK8COM_DATA19enum_server_command + 4728
13  mysqld                              0x00000001036c2789 _Z10do_commandP3THD + 505
14  mysqld                              0x000000010379ba44 handle_connection + 436
15  mysqld                              0x0000000103b11756 pfs_spawn_thread + 310
16  libsystem_pthread.dylib             0x00007fff7ab8b6c1 _pthread_body + 340
17  libsystem_pthread.dylib             0x00007fff7ab8b56d _pthread_body + 0
18  libsystem_pthread.dylib             0x00007fff7ab8ac5d thread_start + 13

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f86b589dc30): drop tablespace ts1
Connection ID (thread ID): 4
Status: NOT_KILLED

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.

3、查看ha_innodb.cc源码的20927行

/******************************************************************//**
Use this when the args are passed to the format string from
errmsg-utf8.txt directly as is.

Push a warning message to the client, it is a wrapper around:

void push_warning_printf(
  THD *thd, Sql_condition::enum_condition_level level,
  uint code, const char *format, ...);
*/
void
ib_senderrf(
/*========*/
  THD*    thd,    /*!< in/out: session */
  ib_log_level_t  level,    /*!< in: warning level */
  ib_uint32_t  code,    /*!< MySQL error code */
  ...)        /*!< Args */
{
  va_list    args;
  char*    str = NULL;
  const char*  format = innobase_get_err_msg(code);

  /* If the caller wants to push a message to the client then
  the caller must pass a valid session handle. */

  ut_a(thd != 0);

  /* The error code must exist in the errmsg-utf8.txt file. */
  ut_a(format != 0);

  va_start(args, code);

#ifdef _WIN32
  int    size = _vscprintf(format, args) + 1;
  if (size > 0) {
    str = static_cast<char*>(malloc(size));
  }
  if (str == NULL) {
    va_end(args);
    return;  /* Watch for Out-Of-Memory */
  }
  str[size - 1] = 0x0;
  vsnprintf(str, size, format, args);
#elif HAVE_VASPRINTF
  int  ret;
  ret = vasprintf(&str, format, args);
  if (ret < 0) {
    va_end(args);
    return;  /* Watch for Out-Of-Memory */
  }
#else
  /* Use a fixed length string. */
  str = static_cast<char*>(malloc(BUFSIZ));
  if (str == NULL) {
    va_end(args);
    return;  /* Watch for Out-Of-Memory */
  }
  my_vsnprintf(str, BUFSIZ, format, args);
#endif /* _WIN32 */

  Sql_condition::enum_severity_level  l;

  l = Sql_condition::SL_NOTE;

  switch (level) {
  case IB_LOG_LEVEL_INFO:
    break;
  case IB_LOG_LEVEL_WARN:
    l = Sql_condition::SL_WARNING;
    break;
  case IB_LOG_LEVEL_ERROR:
    /* We can't use push_warning_printf(), it is a hard error. */
    my_printf_error(code, "%s", MYF(0), str);
    break;
  case IB_LOG_LEVEL_FATAL:
    l = Sql_condition::SEVERITY_END;
    break;
  }

  if (level != IB_LOG_LEVEL_ERROR) {
    push_warning_printf(thd, l, code, "InnoDB: %s", str);
  }

  va_end(args);
  free(str);

  if (level == IB_LOG_LEVEL_FATAL) {
    ut_error;
  }
}

源码只是说传入的参数是不对的,并没有给出具体是为什么会产生这个错误信息,已在官方提交BUG。

相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
3月前
|
存储 关系型数据库 MySQL
MySQL数据库进阶第六篇(InnoDB引擎架构,事务原理,MVCC)
MySQL数据库进阶第六篇(InnoDB引擎架构,事务原理,MVCC)
|
29天前
|
监控 关系型数据库 MySQL
在Linux中,mysql的innodb如何定位锁问题?
在Linux中,mysql的innodb如何定位锁问题?
|
1月前
|
SQL 存储 关系型数据库
"MySQL增列必锁表?揭秘InnoDB在线DDL,让你的数据库操作飞一般,性能无忧!"
【8月更文挑战第11天】在数据库领域,MySQL凭借其稳定高效的表现深受开发者喜爱。对于是否会在给数据表添加列时锁表的问题,MySQL的行为受版本、存储引擎等因素影响。从5.6版起,InnoDB支持在线DDL,可在改动表结构时保持表的可访问性,避免长时间锁表。而MyISAM等则需锁表完成操作。例如,在使用InnoDB的表上运行`ALTER TABLE users ADD COLUMN email VARCHAR(255);`时,通常不会完全锁表。虽然在线DDL提高了灵活性,但复杂操作或大表变更仍可能暂时影响性能。因此,进行结构变更前应评估其影响并择机执行。
48 6
|
3月前
|
存储 SQL 关系型数据库
【MySQL技术内幕】6.3-InnoDB中的锁
【MySQL技术内幕】6.3-InnoDB中的锁
182 57
|
2月前
|
存储 SQL 关系型数据库
(十三)MySQL引擎篇:半道出家的InnoDB为何能替换官方的MyISAM?
MySQL是一款支持拔插式引擎的数据库,在开发过程中你可以根据业务特性,从支持的诸多引擎中选择一款适合的,例如MyISAM、InnoDB、Merge、Memory(HEAP)、BDB(BerkeleyDB)、Example、Federated、Archive、CSV、Blackhole.....
|
3月前
|
存储 关系型数据库 MySQL
关系型数据库mysql的InnoDB
【6月更文挑战第17天】
33 3
|
2月前
|
存储 关系型数据库 MySQL
MySQL InnoDB存储引擎的优点有哪些?
上述提到的特性和优势使得InnoDB引擎非常适合那些要求高可靠性、高性能和事务支持的场景。在使用MySQL进行数据管理时,InnoDB通常是优先考虑的存储引擎选项。
67 0
|
3月前
|
存储 算法 关系型数据库
【MySQL技术内幕】5.7- InnoDB存储引擎中的哈希算法
【MySQL技术内幕】5.7- InnoDB存储引擎中的哈希算法
39 1