When are read repairs blocking or non-blocking in Cassandra? There’s a lot of confusion and misinformation about this, even in the best sources. It’s actually pretty simple.
Read repairs due to read_repair_chance are non-blocking. They are done in the background after results are returned to the client.
On any consistency level that involves more than one node (i.e., all except ANY and ONE), if the read digests don’t match up, read repair is done in a blocking fashion before returning results. (This means that if the repair doesn’t complete in time, the read request can fail.)
Read repairs caused by digest mismatches are blocking in order to ensure monotonic quorum reads. (See https://issues.apache.org/jira/browse/CASSANDRA-10726 .) However, that they are blocking does not only apply when CL=QUORUM or ALL, as some believe. They are blocking for all consistency levels (except ANY and ONE, which don’t compare any digests).
One other detail is that background read repair operates on all replicas of the data. Blocking read repairs only act on the nodes touched to satisfy the consistency level. (Ie, where the digest mismatches were found, and not on nodes that weren’t queried.)
The relevant code is in /src/java/org/apache/cassandra/service/StorageProxy.java .