jepsen-io / jepsen

A framework for distributed systems verification, with fault injection
6.68k stars 711 forks source link

explicitly use ipv4 addresses for hosts in `control.net/ip*` #590

Closed nurturenature closed 3 months ago

nurturenature commented 3 months ago

Hi,

Sometime in the last few months, installing:

changed getent ahosts behavior, (gives systemd-resolved some root cause extended side-eye :eyes: ), to at times return ipv6 addresses vs ipv4:

# changed default behavior
$ getent ahosts n1
fe80::216:3eff:fe6a:845f%3 STREAM n1
fe80::216:3eff:fe6a:845f%3 DGRAM  
fe80::216:3eff:fe6a:845f%3 RAW  

breaking the partition and packet nemeses as iptables and tc filter assume ipv4 and explicitly need an ipv6 option:

# iptables when partitioning
STDERR:  iptables v1.8.9 (nf_tables): host/network `fd42:860c:838f:2817:216:3eff:fe6c:d7c7' not found

# tc filter when packeting
STDERR:  Illegal "match"

This PR updates control.net/ip* to explicitly ask for ipv4 addresses with ahostsv4 vs using the default ahosts:

# explicit ipv4
$ getent ahostsv4 n1
10.82.244.5     STREAM n1
10.82.244.5     DGRAM  
10.82.244.5     RAW 

I also considered conditionally changing the partition and packet command lines based on interpreting the ip address, regex, but that felt clunky.

I think this change will be non-breaking as:

This has been tested on Debian Bookworm using LXD.

Thanks!

aphyr commented 3 months ago

Sounds good to me! None of this new-fangled v6 nonsense ;-)