Coder Social home page Coder Social logo

mysql-slave-self-healing's Introduction

mysql-slave-self-healing

MySQL Slave故障自愈

1、项目背景:

1.1、对主备数据一致性要求较高的场景,比如腾讯游戏存储的是玩家数据,备库开放给各种周边系统查询。当slave故障,我们希望备库能够安全地自动修复。

1.2、该项目核心修复逻辑是想通过Percona的开源工具:pt-slave-restart来完成,但显然,该工具存在不足。目前只模糊的定义了3种修复模式,分别是SQL语法错误、MyISAM表损坏以及中继日志的损坏,除此之外,其他一切错误都是通过sql_slave_skip_counter来完成,简单且粗暴,对数据的一致性造成成吨伤害。

1.3、业界同行对主备故障的修复经验值得积累,如果每个DBA都将这些经验沉淀到这个工具中,前人栽树,后来者只要部署下这个工具即可,把时间用去对业务、对自己更有帮助的事情上,送人玫瑰,手留余香,岂不快哉?

2、怎么参与?

虽然该工具接近6千多行代码,但逻辑比较清晰,只要你是DBA,并且会一点Perl,那么你只需要:

2.1、找到数组 @error_patterns,定义你遇到过的case

2.2、找到哈希 %actions,写下你的处理经验

希望这是件有意义的事情 :)

mysql-slave-self-healing's People

Contributors

linwaterbin avatar vinchen avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.