diff --git a/Debugging.md b/Debugging.md index 187905d..01c41a9 100644 --- a/Debugging.md +++ b/Debugging.md @@ -7,9 +7,39 @@ ### Tasks: * Reduce network bandwidth between the VMs: - * Use https://github.com/thombashi/tcconfig instead of Linux `tc` - * `tcset eth0 --rate 100Mbps --direction incoming --src-network 192.168.124.233/32 --overwrite` - + * Use https://github.com/thombashi/tcconfig instead of Linux `tc` + * `tcset eth0 --rate 100Mbps --direction incoming --src-network 192.168.124.233/32 --overwrite` +* Fake zfs errors + * Create a wrapper shell script and add its director to the zrepl daemon's `PATH` + * Example Script:
+ ``` + root@zrepl-dev-debian-2:[~]: cat mockpath/zfs + #!/usr/bin/env bash + set -eu + args=("$@") + + ZREPL_MOCK_ZFS_PATH=/usr/local/sbin/zfs + + + #if echo "${args[@]}" | egrep 'list.*snapshot' > /dev/null; then + # echo "sleeping ${args[@]}" >> /tmp/mocklog + # sleep 700 + #fi + if echo "${args[@]}" | egrep 'recv -s' 2>&1 >/dev/null; then + echo foo + echo bar 1>&2 + sleep 10 + dd bs=1M count=1 + exit 23 + #echo "unenced is blocked to be received by this mock" 1>&2 + #exit 23 + sleep 1 + fi + + + exec "$ZREPL_MOCK_ZFS_PATH" "${args[@]}" + ``` +
## Memory Leaks & Goroutine Leaks