{"record":{"id":"e818ba015464195b","repo":"apache/cassandra","slug":"readfailureexception-consistency-s-received-s","errorCode":null,"errorMessage":"ReadFailureException(consistency=%s, received=%s, blockFor=%s, dataPresent=false, failureReasonByEndpoint=%s)","messagePattern":"ReadFailureException\\(consistency=(.+?), received=(.+?), blockFor=(.+?), dataPresent=false, failureReasonByEndpoint=(.+?)\\)","errorType":"exception","errorClass":"ReadFailureException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/StorageProxy.java","lineNumber":2394,"sourceCode":"                // 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        {\n            readMetrics.timeouts.mark();\n            casReadMetrics.timeouts.mark();\n            readMetricsForLevel(consistencyLevel).timeouts.mark();\n            logRequestException(e, group.queries);","sourceCodeStart":2376,"sourceCodeEnd":2412,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/StorageProxy.java#L2376-L2412","documentation":"A ReadFailureException rethrown when the Paxos PROPOSE phase of a serial read fails with a WriteFailureException. It carries the received/blockFor counts and per-endpoint failure reasons from the underlying write, with dataPresent=false.","triggerScenarios":"Same code path as the read timeout case, but replicas explicitly reported failure (e.g., node down, disk error, tombstone/limit breaches during the proposal write), so WriteFailureException is converted to ReadFailureException in the catch block.","commonSituations":"A replica crashed or was decommissioned mid-LWT operation; replicated writes failing below required blockFor due to hardware problems or overloaded replicas.","solutions":["Inspect failureReasonByEndpoint (in the driver exception) to find which replicas failed and why.","Repair or replace the failing replicas; run nodetool repair after they return.","Retry the serial read once replicas are healthy.","Ensure RF and consistency level allow quorum to proceed despite one unhealthy replica."],"exampleFix":"// before\nResultSet rs = session.execute(lwtRead);\n// after\ntry {\n    ResultSet rs = session.execute(lwtRead);\n} catch (AllNodesFailedException | ReadFailureException e) {\n    // inspect e.getAllErrorMessage()/failure reasons, remediate replicas, retry\n}","handlingStrategy":"try-catch","validationCode":"int aliveReplicas = countHealthyReplicas(key, consistencyLevel);\nif (aliveReplicas < consistencyLevel.blockFor(rf)) failFast(\"insufficient replicas for serial read\");","typeGuard":null,"tryCatchPattern":"catch (ReadFailureException e) {\n    e.getFailuresMap().forEach((ep, reason) -> log.error(\"replica {} failed: {}\", ep, reason));\n    remediateAndRetry();\n}","preventionTips":["Monitor per-endpoint write failures and repair/replace bad replicas quickly.","Keep RF high enough that quorum survives one unhealthy replica.","Alert on ReadFailure metrics by datacenter.","Run regular repairs so failed proposals leave no divergent state."],"tags":["cassandra","read-failure","paxos","replica-health"],"backgroundTag":"http-error-response","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"}