shlogg · Early preview
Franck Pachot @franckpachot

Testing Clock Skew In Distributed Systems With YugabyteDB And Docker

Clock skew test in YugabyteDB: faked `clock_gettime` function to simulate time drift. Physical Time shows skew, but Logical Time remains synchronized.

In real deployments, without atomic clocks, the time synchronized by NTP can drift, and servers in a distributed system can show a clock skew of hundreds of milliseconds. A simple way to test this in a Docker lab is to fake the clock_gettime function. Here is an example with a 2-node RF1 YugabyteDB cluster (PostgreSQL-compatible Distributed SQL database).
I create a yb network and start the first node, yb1 in the background:

docker network create yb
docker run -d  --rm --network yb --hostname yb1 -p 7000:7000 yugabytedb/yugabyte yugabyted start --background=false --tserver_flags="TEST_docdb_l...