{"record":{"id":"b766d16214856e02","repo":"apache/cassandra","slug":"could-not-perform-consistent-fetch-downgrading-to","errorCode":null,"errorMessage":"Could not perform consistent fetch, downgrading to fetching from CMS peers.","messagePattern":"Could not perform consistent fetch, downgrading to fetching from CMS peers\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/tcm/PaxosBackedProcessor.java","lineNumber":96,"sourceCode":"    @Override\n    public ClusterMetadata fetchLogAndWait(Epoch waitFor, Retry retryPolicy)\n    {\n        ClusterMetadata metadata = log.waitForHighestConsecutive();\n\n        // We can perform a local-only read without going through paxos subsystem in case of a single CMS node.\n        if (metadata.fullCMSMembers().size() > 1)\n        {\n            try\n            {\n                // Attempt to perform a consistent fetch\n                log.append(DistributedMetadataLogKeyspace.getLogState(metadata.epoch, true));\n                return log.waitForHighestConsecutive();\n            }\n            catch (Throwable t)\n            {\n                JVMStabilityInspector.inspectThrowable(t);\n                TCMMetrics.instance.fetchCMSLogConsistencyDowngrade.mark();\n                logger.warn(\"Could not perform consistent fetch, downgrading to fetching from CMS peers.\", t);\n            }\n        }\n\n        EndpointsForRange replicas = metadata.fullCMSMembersAsReplicas();\n\n        // We prefer to always perform a consistent fetch (i.e. Paxos read of the distributed log state table).\n        // However, in some cases (specifically, during CMS membership changes) this may not be possible, as Paxos\n        // relies on matching Participants, and there might be a mismatch during the membership change. In such\n        // case, we allow inconsistent fetch. In other words, replay from local log of the majority of the CMS replicas.\n        int blockFor = replicas.size() == 1 ? 1 : (replicas.size() / 2) + 1;\n\n        Set<InetAddressAndPort> collected = new HashSet<>(blockFor);\n        Set<FetchLogRequest> requests = new HashSet<>();\n        AtomicReference<Epoch> highestSeen = new AtomicReference<>(metadata.epoch);\n\n        for (Replica peer : replicas)\n            requests.add(new FetchLogRequest(peer, MessagingService.instance(), metadata.epoch));\n","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tcm/PaxosBackedProcessor.java#L78-L114","documentation":"PaxosBackedProcessor.fetchLogAndWait first tries a consistent fetch (Paxos read of the distributed log state). If that throws, it marks a consistency-downgrade metric and logs this warning, then falls back to fetching the log from CMS peers directly. The fetch still proceeds, just without the stronger consistency guarantee.","triggerScenarios":"A consistent log fetch fails — Paxos round timeout, a CMS member unavailable, or a commit/read failure on the log state table — triggering the catch block's downgrade path.","commonSituations":"CMS quorum degraded (a member down or slow); network latency between node and CMS; heavy load causing Paxos timeouts during large topology changes.","solutions":["Check health of all CMS members and restore quorum (`nodetool cms show`, `nodetool status`).","Investigate the attached Throwable; timeouts usually mean load or network issues.","Ensure the fetch that follows succeeds; if it does, no further action needed.","If downgrades are frequent, add capacity or review CMS replication factor placement."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// check CMS quorum health before consistent fetch\nif (!metadata.fullCMSMembersAsReplicas().stream().allMatch(FailureDetector.instance::isAlive)) logger.debug(\"CMS quorum degraded; downgrade expected\");","typeGuard":null,"tryCatchPattern":"try { consistentFetch(); } catch (Throwable t) { peerFetch(); // documented downgrade path }","preventionTips":["Restore failed CMS members promptly","Monitor fetchCMSLogConsistencyDowngrade metric","Keep CMS replication factor matched to DC topology"],"tags":["paxos","consistency-downgrade","cms"],"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"}