{"record":{"id":"85bfefd5b9d76156","repo":"apache/cassandra","slug":"readtimeoutexception-85bfef","errorCode":null,"errorMessage":"ReadTimeoutException","messagePattern":"ReadTimeoutException","errorType":"exception","errorClass":"ReadTimeoutException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/reads/repair/BlockingReadRepairs.java","lineNumber":91,"sourceCode":"                             MAX_MUTATION_SIZE,\n                             metadata,\n                             metadata.partitionKeyType.getString(key.getKey()),\n                             destination);\n            }\n            else\n            {\n                logger.warn(\"Encountered an oversized ({}/{}) read repair mutation for table {}, key {}, node {}\",\n                            e.mutationSize,\n                            MAX_MUTATION_SIZE,\n                            metadata,\n                            metadata.partitionKeyType.getString(key.getKey()),\n                            destination);\n\n                if (!suppressException)\n                {\n                    int blockFor = consistency.blockFor(keyspace.getReplicationStrategy());\n                    Tracing.trace(\"Timed out while read-repairing after receiving all {} data and digest responses\", blockFor);\n                    throw new ReadTimeoutException(consistency, blockFor - 1, blockFor, true);\n                }\n            }\n            return null;\n        }\n    }\n}\n","sourceCodeStart":73,"sourceCodeEnd":98,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/reads/repair/BlockingReadRepairs.java#L73-L98","documentation":"BlockingReadRepairs.createRepairMutation throws ReadTimeoutException when repair mutations are constructed for a read-repair but the awaited acknowledgments time out, unless suppressException is set. The client gets a ReadTimeoutException with received = blockFor-1, indicating the read-repair write phase could not complete for the required consistency level.","triggerScenarios":"Digest-mismatched read at a consistency level; repair mutations are sent to stale replicas; awaited acks time out; if the caller did not suppress the exception (background/speculative repairs), it is rethrown to the coordinator thread.","commonSituations":"Divergent replicas after node replacement or long downtime; tombstone-heavy rows making repair writes exceed timeouts; low consistency levels combined with frequently stale replicas.","solutions":["Run a full/primary-range nodetool repair to resynchronize replicas","Raise write_request_timeout_in_ms and range/request timeouts if repairs are data-heavy","Investigate replica failure reasons (dropped mutations, overload) via nodetool tpstats and logs","Suppress/repair asynchronously if the workload shouldn't fail reads on repair timeouts (version-dependent behavior)"],"exampleFix":"// before\n// reads fail while replicas diverge\n// after\n$ nodetool repair -pr ks tbl   # then reads stop triggering blocking repairs","handlingStrategy":"retry","validationCode":"// Detect stale replicas proactively: alert on repair age (last repair > gc_grace) before issuing strict-CL reads","typeGuard":null,"tryCatchPattern":"try {\n  return session.execute(query);\n} catch (e) {\n  if (e instanceof ReadTimeoutException && /read-repair/i.test(String(e.message || ''))) {\n    return retryWithBackoff(query, 1); // transient repair timeout\n  }\n  throw e;\n}","preventionTips":["Run incremental or full repairs on schedule to keep replicas consistent","Investigate failure reasons logged with the timeout (node down, dropped mutations)","Tune write_request_timeout_in_ms for tombstone-heavy tables","Watch digest-mismatch/read-repair metrics as an early-warning signal"],"tags":["read-repair","read-timeout","consistency","replication"],"backgroundTag":"request-timeout","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}