We present a framework for efficient stateless model checking (SMC) of concurrent programs under three prominent models of causal consistency, $${\texttt {CCv}}, {\texttt {CM}}, \texttt{CC}$$
CCv
,
CM
,
CC
. Our approach is based on exploring traces under the program order
"Image missing"
and the reads from
"Image missing"
relations. Our SMC algorithm is provably optimal in the sense that it explores each
"Image missing"
and
"Image missing"
relation exactly once. We have implemented our framework in a tool called Conschecker. Experiments show that Conschecker performs well in detecting anomalies in classical distributed databases benchmarks.