{"record":{"id":"68f3c9bdc663be0f","repo":"apache/cassandra","slug":"insufficient-read-responses-readresponses-nee","errorCode":null,"errorMessage":"Insufficient read responses: ${readResponses}; need ${sizeOfReadQuorum}","messagePattern":"Insufficient read responses: (.+?); need (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/paxos/PaxosPrepare.java","lineNumber":662,"sourceCode":"                    break;\n\n                case AFTER:\n                    if (maybeCheckForLinearizabilityViolation(permitted, from))\n                        return;\n                    // witnessing future commit doesn't imply have seen prior, so add to refresh list\n\n                case BEFORE:\n                    if (needLatest == null)\n                        needLatest = new ArrayList<>(participants.sizeOfPoll() - withLatest.size());\n                    needLatest.add(from);\n            }\n        }\n\n        haveQuorumOfPermissions |= withLatest() + needLatest() >= participants.sizeOfConsensusQuorum;\n        if (haveQuorumOfPermissions)\n        {\n            if (request.read != null && readResponses.size() < participants.sizeOfReadQuorum)\n                throw new IllegalStateException(\"Insufficient read responses: \" + readResponses + \"; need \" + participants.sizeOfReadQuorum);\n\n            if (!hasOnlyPromises && !hasProposalStability)\n                signalDone(SUPERSEDED);\n\n            // We must be certain to have witnessed a quorum of responses before completing any in-progress proposal\n            // else we may complete a stale proposal that did not reach a quorum (and may do so in preference\n            // to a different in progress proposal that did reach a quorum).\n\n            // We should also be sure to return any in progress proposal in preference to any incompletely committed\n            // earlier commits (since, while we should encounter it next round, any commit that is incomplete in the\n            // presence of an incomplete proposal can be ignored, as either the proposal is a re-proposal of the same\n            // commit or the commit has already reached a quorum\n            else if (hasInProgressProposal())\n                signalDone(hasOnlyPromises ? FOUND_INCOMPLETE_ACCEPTED : SUPERSEDED);\n\n            else if (withLatest() >= participants.sizeOfConsensusQuorum)\n                signalDone(hasOnlyPromises ? PROMISED : READ_PERMITTED);\n","sourceCodeStart":644,"sourceCodeEnd":680,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/paxos/PaxosPrepare.java#L644-L680","documentation":"In PaxosPrepare, once a quorum of permissions is witnessed, a serial (read) request must already hold a read quorum of responses. If not — an internal invariant violation in response accounting — this IllegalStateException is thrown rather than proceeding with an unsafe read decision.","triggerScenarios":"A serial consensus read whose prepare phase collected enough 'permissions' (promises/quorum) from participants but fewer read responses than participants.sizeOfReadQuorum by the time the quorum of permissions triggers completion — i.e. responses arrived out of order or a read quorum was never satisfied while the permission quorum fired.","commonSituations":"Node faults/restarts mid-prepare leaving the coordinator with a skewed response mix; races between onResponse callbacks and electorate changes; genuine internal bug triggered by unusual failure/timing patterns during Paxos reads; mixed-version clusters with differing quorum accounting.","solutions":["Retry the serial operation — this is usually a transient race; log the exception with tracing for diagnosis","Verify cluster health and schema agreement (all nodes same version, no flapping nodes)","If reproducible, gather logs/ccm repro and report as a Cassandra bug (internal invariant violated)","Ensure the read quorum is achievable for the RF and consistency level before issuing serial reads (healthy replicas)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// ensure healthy replica set for serial reads before issuing\n// nodetool status / system.peers check: live replicas >= RF for the table","typeGuard":null,"tryCatchPattern":"try { session.execute(serialRead); }\ncatch (DriverException e) { /* IllegalStateException from coordinator: retry; if persistent, collect logs and file a bug */ }","preventionTips":["Keep all replicas healthy during serial-read-heavy workloads","Keep the cluster on a uniform Cassandra version","Enable tracing and retain logs for Paxos invariant violations to aid bug reports"],"tags":["paxos","internal-error","invariant","quorum"],"backgroundTag":"internal-invariant-violation","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"}