{"record":{"id":"849d48f2f901d73f","repo":"apache/cassandra","slug":"readtimeoutexception-consistency-s-received-0-b","errorCode":null,"errorMessage":"ReadTimeoutException(consistency=%s, received=0, blockFor=%s, dataPresent=false)","messagePattern":"ReadTimeoutException\\(consistency=(.+?), received=0, blockFor=(.+?), dataPresent=false\\)","errorType":"exception","errorClass":"ReadTimeoutException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/StorageProxy.java","lineNumber":2390,"sourceCode":"                    !Paxos.isLinearizable()\n                    ? ballot -> null\n                    : ballot -> Pair.create(PartitionUpdate.emptyUpdate(metadata, key), null);\n                // When replaying, we commit at quorum/local quorum, as we want to be sure the following read (done at\n                // quorum/local_quorum) sees any replayed updates. Our own update is however empty, and those don't even\n                // get committed due to an optimiation described in doPaxos/beingRepairAndPaxos, so the commit\n                // consistency is irrelevant (we use ANY just to emphasis that we don't wait on our commit).\n                doPaxos(metadata,\n                        key,\n                        consistencyLevel,\n                        consistencyForReplayCommitsOrFetch,\n                        ConsistencyLevel.ANY,\n                        requestTime,\n                        casReadMetrics,\n                        updateProposer);\n            }\n            catch (WriteTimeoutException e)\n            {\n                throw new ReadTimeoutException(consistencyLevel, 0, blockForRead, false);\n            }\n            catch (WriteFailureException e)\n            {\n                throw new ReadFailureException(consistencyLevel, e.received, e.blockFor, false, e.failureReasonByEndpoint);\n            }\n\n            return serialReadResult(fetchRows(group.queries, consistencyForReplayCommitsOrFetch, ReadCoordinator.DEFAULT, requestTime));\n        }\n        catch (UnavailableException e)\n        {\n            readMetrics.unavailables.mark();\n            casReadMetrics.unavailables.mark();\n            readMetricsForLevel(consistencyLevel).unavailables.mark();\n            logRequestException(e, group.queries);\n            throw e;\n        }\n        catch (ReadTimeoutException e)\n        {","sourceCodeStart":2372,"sourceCodeEnd":2408,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/StorageProxy.java#L2372-L2408","documentation":"A ReadTimeoutException (received=0, dataPresent=false) rethrown when the Paxos PROPOSE phase of a serial read times out as a WriteTimeoutException. It is translated so LWT callers see a read-side timeout consistent with the operation type.","triggerScenarios":"legacyReadWithPaxos/ReadPhase BEGIN/PROPOSE: the Paxos proposal write does not reach blockForRead replicas within write timeout (cas_contention_timeout / write_request_timeout exceeded), so the catch block converts WriteTimeoutException to ReadTimeoutException(consistency, 0, blockForRead, false).","commonSituations":"Contended LWT rows (many CAS proposals on the same partition), slow replicas, write_request_timeout too low, node stalls during Paxos rounds.","solutions":["Retry the serial read; Paxos timeouts on contention are usually transient.","Reduce contention on the partition (spread hot keys, fewer concurrent LWTs per row).","Increase write_request_timeout and cas_contention_timeout in cassandra.yaml if the cluster is consistently slow.","Check replica health and GC pauses that inflate Paxos round latency."],"exampleFix":"// before\nResultSet rs = session.execute(serialRead);\n// after\ntry {\n    ResultSet rs = session.execute(serialRead);\n} catch (ReadTimeoutException | com.datastax.driver.core.exceptions.ReadTimeoutException e) {\n    // retry with backoff; 0 of blockFor acked\n}","handlingStrategy":"retry","validationCode":"long contention = currentLwtInFlightFor(key);\nif (contention > threshold) yieldOrQueueInsteadOfLwt(key);","typeGuard":null,"tryCatchPattern":"catch (ReadTimeoutException e) {\n    if (e.getCode() == 0x1200 && !e.wasDataPresent()) {\n        sleep(jitter(backoff));\n        return retrySerialRead(); // Paxos timeouts on contention are transient\n    }\n    throw e;\n}","preventionTips":["Minimize concurrent LWTs on the same partition.","Tune write_request_timeout and cas_contention_timeout for your replica latency.","Watch Paxos metrics (cas read/write contention) and alert on spikes.","Keep replicas healthy; investigate GC pauses and disk latency."],"tags":["cassandra","timeout","paxos","lwt"],"backgroundTag":"request-timeout","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}