Pumba lets you take ideas from previous tools and apply them in a container setting. This is useful since it can be used as part of existing tooling in your infrastructure.
Start off by spinning up some Docker containers to represent a system:
Prior to running this command running CREATE DATABASE example; will succeed nearly immediately. Running the same during the 15s failure window will delay this write operation until the system recovers.
Kill a Container
Send the main process inside a container the KILL signal:
pumba kill tidbdockercompose_tikv0_1
Network Emulation
If your image doesn't have tc installed, you need to run docker pull gaiadocker/iproute2 and use netem --tc-image gaiadocker/iproute2 instead of just netem.
Introducing a delay to two of the storage nodes:
Introducing 99% packet loss on all three storage nodes:
Exercises
Try using the --random parameter to randomly select a node from passed set.
Try using the regex syntax to target specific nodes.
Compare a true distributed system (like TiDB) against a traditional system (Postgres + Client).