故障现象
2016.1.1号早上4点左右,zabbi数据库服务器报警,写入数据失败。登陆机器后检查发现磁盘空间使用95%没有用满,进去zabbix数据库,执行insert命令提示错误“errir 1030(HY000):got error 28 from storage engine”. 
 
前提
zabbix数据库由于超大的写入量,我们使用tokudb存储引擎来存储,此引擎有强大的压缩比,写入性能也非常不错,适合zabbix数据库场景。
 
故障调查
1)检查错误日志,发现有如下
Version: '5.6.22-72.0-log'  socket: '/tmp/mysql.socket'  port: 3306  Percona Server (GPL), Release 72.0, Revision 738
Sun Dec 27 06:18:58 2015 TokuFT file system space is low
Sun Dec 27 06:22:58 2015 TokuFT file system space is low
Sun Dec 27 06:26:43 2015 TokuFT file system space is low
Sun Dec 27 06:30:48 2015 TokuFT file system space is low
Sun Dec 27 06:34:48 2015 TokuFT file system space is low
Sun Dec 27 06:38:43 2015 TokuFT file system space is low
Fri Jan 1 03:57:56 2016 TokuFT file system space is really low and access is restricted
Fri Jan 1 04:25:56 2016 TokuFT file system space is really low and access is restricted
Fri Jan 1 05:52:07 2016 TokuFT file system space is really low and access is restricted
Fri Jan 1 07:33:47 2016 TokuFT file system space is really low and access is restricted
在3.57的时候开始报“Fri Jan 1 03:57:56 2016 TokuFT file system space is really low and access is restricted”错误。翻译一下就是说系统磁盘空间不足了,请求被拒绝。这个时间和DB写入失败时间一致。
 
2)查看percona官方文档,发现有一个变量是控制磁盘剩余空间检查的
variable tokudb_fs_reserve_percent

This variable controls the percentage of the file system that must be available for inserts to be allowed. By default, this is set to 5. We recommend that this reserve be at least half the size of your physical memory. See Full Disks for more information.
看到默认设置是5,也就是说磁盘剩余可用空间低于5%的时候,拒绝写入,直到释放出更多的空间
 
3)进一步查看full disk information,得到一个信息,“TokuDB polls the file system every five seconds to determine how much free space is available”每5秒钟去检测一次磁盘空间。
Details about the disk system:
There is a free-space reserve requirement, which is a user-configurable parameter given as a percentage of the total space in the file system. The default reserve is five percent. This value is available in the global variable tokudb_fs_reserve_percent. We recommend that this reserve be at least half the size of your physical memory.
TokuDB polls the file system every five seconds to determine how much free space is available. If the free space dips below the reserve, then further table inserts are prohibited. Any transaction that attempts to insert rows will be aborted. Inserts are re-enabled when twice the reserve is available in the file system (so freeing a small amount of disk storage will not be sufficient to resume inserts). Warning messages are sent to the system error log when free space dips below twice the reserve and again when free space dips below the reserve.
Even with inserts prohibited it is still possible for the file system to become completely full. For example this can happen because another storage engine or another application consumes disk space.
If the file system becomes completely full, then TokuDB will freeze. It will not crash, but it will not respond to most SQL commands until some disk space is made available. When TokuDB is frozen in this state, it will still respond to the following command:
 
4)尝试动态设置这个参数,发现是个只读参数,需要重启服务
mysql> set global tokudb_fs_reserve_percent=4;
ERROR 1238 (HY000): Variable 'tokudb_fs_reserve_percent' is a read only variable
结论
tokudb为了保障数据库服务正常,每5秒检测一次磁盘剩余空间,默认剩余5%的时候阻塞写入,直到释放更多的空间再恢复正常。通过tokudb_fs_reserve_percent变量控制剩余百分比,这是个只读变量。在INNODB,MYISAM等引擎上没有这个参数可配置,磁盘可以写到100%。大家在使用tokudb的时候不要忘记这个参数,磁盘到95%之前就要准备扩容了。

tokudb引擎磁盘空间不足导致写入失败的调查的更多相关文章

  1. oracle所在磁盘空间不足导致了数据库异常

    oracle所在磁盘空间不足导致了数据库异常.需要减小数据文件的大小来解决. 1.检查数据文件的名称和编号 select file#,name from v$datafile; 2.看哪个数据文件所占 ...

  2. swap空间不够导致安装失败解决方法

    在安装Oracle的时候,可能因为我们分配的swap空间不够导致安装失败.处理步骤如下: SWAP空间为2G [root@linux01 oracle]# free            total  ...

  3. 因磁盘空间不足导致HDFS的NameNode进入安全模式问题记录

    因磁盘空间不足导致HDFS的NameNode进入安全模式问题记录,调用API上传及下载文件时报如下错误信息: org.apache.hadoop.ipc.RemoteException(org.apa ...

  4. Oracle 不小心删除undo数据文件以及磁盘空间不足导致不能登录的解决办法

    在一次测试中,由于导入的数据量过大导致事务一直提交失败因为磁盘空间不够用了,一检查发现是undo表空间不够用,于是重新创建了一个表空间,准备把之前的undo表空间删除,删除时却发现一直删不掉,因为它一 ...

  5. 阿里云rds 磁盘空间满导致实例锁定

    1.RDS 数据日志已经快满了, 导致数据库不能写入,只读. 2. Binlog日志的保存及清理规则 MySQL实例的空间内默认清理binlog日志的规则如下: 实例空间内默认会保存最近18个小时内的 ...

  6. DG备库磁盘空间满导致无法创建归档

    上周五去某客户那里做数据库巡检.是window 2008系统上10g的一套NC系统的库,已经配置了DG,可是巡检时发现数据库报错: Tue Nov 11 10:13:57 2014 LNS: Stan ...

  7. osd磁盘空间足够无法写入数据的分析与解决

    前言 这个问题的来源是ceph社区里面一个群友的环境出现在85%左右的时候,启动osd报错,然后在本地文件系统当中进行touch文件的时候也是报错,df -i查询inode也是没用多少,使用的也是in ...

  8. 故障案例 | 主从复制环境中tokudb引擎报错排查过程

    欢迎来到 GreatSQL社区分享的MySQL技术文章,如有疑问或想学习的内容,可以在下方评论区留言,看到后会进行解答 GreatSQL社区原创内容未经授权不得随意使用,转载请联系小编并注明来源. 0 ...

  9. Linux下几个与磁盘空间和文件尺寸相关的命令

    大家好,我是良许. 硬盘是计算机非常重要的一个部件,不管是代码,还是 UI .声音.文档,抑或是没人时偷偷看的小视频,都需要保存在硬盘里. 对于很多 Linux 服务器,会进行很多的编译操作.而编译操 ...

随机推荐

  1. java开发命名规范

    使用前注意事项: 1.  由于Java面向对象编程的特性, 在命名时应尽量选择名词 2.  驼峰命名法(Camel-Case): 当变量名或函式名是由一个或多个单字连结在一起,而构成的唯一识别字时,首 ...

  2. Luogu 3396 权值分块

    官方题解:这是一道论文题.集训队论文<根号算法——不只是分块>. 首先,题目要我们求的东西,就是下面的代码: for(i=k;i<=n;i+=p) ans+=value[i]; 即: ...

  3. BackTrack5-r3安装VMware Tools

    bt login:root //默认的BT系统账号password:toor //默认的BT系统密码,这里的密码是不显示的.root@bt:~#startx //进入图形模式 启动BT虚拟机系统-在V ...

  4. Linux服务器之间的目录共享

    1.在Redhat Linux中查看是否已安装NFS及portmap的命令如下:rpm -qa |grep portmaprpm -qa |grep nfs2.如果没有安装这两个软件包,安装命令如下: ...

  5. Excel中如何过滤复选框 How to filter checkbox column in Excel

    有个笨笨的小伙伴最近老跟Excel过不去. 她新加了一列checkbox,还想filter别人有没有选.写代码又不会,怎么办. 1. 首先,加这个checkbox 2. 然后新建一列,把这个check ...

  6. Android中下载、安装和卸载(原)

    应用场景:在检查版本更新的时候经常需要从服务器端下载然后安装到手机中 使用工具: XUtils,这个开源的框架真的是需要花大把时间去阅读和理解的,十分有用的,on the way ! fighting ...

  7. HTTPURLConnection 发送Post数据

    在使用HTTPURLConnection发送POST数据时,通常使用如下方式: byte[] body = new byte[512]; // 需要发送的body数据 URL url = new UR ...

  8. How to ssh to your Amazon Elastic Beanstalk instance?

    Well, if it's ec2 or a digital ocean server, it would be a lot easier- you do what you normally do f ...

  9. 用bugzilla统计BUG

    bugzilla—— reports—— Tabular reports—— 选择版本号啥的跟search一样 上面的行标Vertical Axis选Resolution:列标Horizontal A ...

  10. 在linux中使用cmake编译运行cocos2d-x 3.4 projects

    原因: 由于不想在真机环境和 ide中调试环境, 只想在linux端进行 调试和运行, 需要使用cmake对现有的游戏进行编译(cocos2dx-lua 3.4) 修改步骤: 1.修改framewor ...