Giter Site home page Giter Site logo

knightxun / tipocket Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pingcap/tipocket

0.0 1.0 0.0 18.06 MB

A toolkit for testing TiDB

Home Page: https://github.com/pingcap/tipocket

License: Apache License 2.0

Go 99.36% Makefile 0.48% Shell 0.13% Dockerfile 0.04%

tipocket's Introduction

TiPocket

TiPocket is a testing toolkit designed to test TiDB, it encapsulates some testing tools which are also suitable for testing other databases.

TiPocket is inspired by jepsen-io/jepsen, a famous library on the distributed system field. TiPocket focuses on stability testing on TiDB, it uses chaos-mesh to inject all-round kinds of nemesis on a TiDB cluster.

Requirements

Toolkit

  • go-sqlsmith: go-sqlsmith is our Go implementation of sqlsmith, it's a fuzz-testing tool which can generate random MySQL-dialect SQL queries.
  • go-elle: Our Go port version of jepsen-io/elle, a general transactional consistency checker for black-box databases.

Nemesis

  • random_kill, all_kill, minor_kill, major_kill, kill_tikv_1node_5min, kill_pd_leader_5min: As their name implies, these nemeses inject unavailable in a specified period of time.
  • short_kill_tikv_1node, short_kill_pd_leader: Kill selected container, used to inject short duration of unavailable fault.
  • partition_one: Isolate single nodes
  • scaling: Scale up/down TiDB/PD/TiKV nodes randomly
  • shuffle-leader-scheduler/shuffle-region-scheduler/random-merge-scheduler: Just as there name implies.
  • delay_tikv, delay_pd, errno_tikv, errno_pd, mixed_tikv, mixed_pd: Inject IO-related fault.
  • small_skews, subcritical_skews, critical_skews, big_skews, huge_skews: Clock skew, small_skews ~100ms, subcritical_skews ~200ms, critical_skews ~250ms, big_skews ~500ms and huge_skews ~5s.

Debug and Run

If you have a K8s cluster, you can use the below commands to deploy and run the case on a TiDB cluster.

On a K8s cluster

make build
export KUBECONFIG=$(YOUR_KUBECONFIG_PATH)
bin/${testcase} -namespace=${ns} -hub=docker.io -image-version=nightly -purge=true -storage-class=local-storage

On the local environment

Another convenient way we recommend you is using tiup to deploy a cluster on local and use it to debug cases.

  • Start a TiDB cluster
tiup playground --kv 3
  • Specify that cluster address through -tidb-server -tikv-server and -pd-server
-tidb-server 127.0.0.1:4000 
  • If a cluster has many service addresses, you can pass a flag multiple times
-tikv-server 127.0.0.1:20160 -tikv-server 127.0.0.1:20161

Workloads

TiPocket includes some consistency, isolation and other kinds of tests

Consistency

  • bank transfers between rows of a shared table
  • pbank check bank accounts using a linearizability checker porcupine
  • vbank like bank but cover more TiKV features
  • ledger yet another bank test
  • rawkv-linearizability rawkv linearizability checker
  • tpcc use go-tpc testing consistency

Isolation

  • append checks for dependency cycles in transactions using Elle
  • register checks for write-read dependency cycles over read-write registers using Elle

tipocket's People

Contributors

mahjonp avatar yeya24 avatar you06 avatar cwen0 avatar maplefu avatar hunterlxt avatar illyrix avatar fewdan avatar csuzhangxc avatar zhouqiang-cl avatar gengliqi avatar sticnarf avatar coocood avatar aylei avatar 5kbpers avatar chenpeng2013 avatar connor1996 avatar youjiali1995 avatar overvenus avatar ethercflow avatar amyangfei avatar cosven avatar hicqu avatar siddontang avatar

Watchers

 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.