{"record":{"id":"2866d556cfd6744d","repo":"apache/cassandra","slug":"failed-to-update-the-distributed-status-of-view-s","errorCode":null,"errorMessage":"Failed to update the distributed status of view, sleeping 5 minutes before retrying","messagePattern":"Failed to update the distributed status of view, sleeping 5 minutes before retrying","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/db/view/ViewBuilder.java","lineNumber":226,"sourceCode":"\n    private void finish()\n    {\n        logger.debug(\"Marking view({}.{}) as built after covering {} keys \", ksName, view.name, keysBuilt);\n        SystemKeyspace.finishViewBuildStatus(ksName, view.name);\n        updateDistributed();\n    }\n\n    private void updateDistributed()\n    {\n        try\n        {\n            SystemDistributedKeyspace.successfulViewBuild(ksName, view.name, localHostId);\n            SystemKeyspace.setViewBuiltReplicated(ksName, view.name);\n        }\n        catch (Exception e)\n        {\n            ScheduledExecutors.nonPeriodicTasks.schedule(this::updateDistributed, 5, TimeUnit.MINUTES);\n            logger.warn(\"Failed to update the distributed status of view, sleeping 5 minutes before retrying\", e);\n        }\n    }\n\n    /**\n     * Stops the view building.\n     */\n    void stop()\n    {\n        boolean wasStopped;\n        synchronized (this)\n        {\n            wasStopped = isStopped;\n            internalStop(false);\n        }\n        // TODO: very unclear what the goal is here. why do we wait only if we were the first to invoke stop?\n        // but we wait outside the synchronized block to avoid a deadlock with `build` in the future callback\n        if (!wasStopped)\n            FBUtilities.waitOnFuture(future);","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/view/ViewBuilder.java#L208-L244","documentation":"ViewBuilder.updateDistributed() writes the view build status to the distributed system keyspaces (successfulViewBuild in system_distributed and setViewBuiltReplicated in system local tables). If either write throws, it logs this warning and schedules itself to retry in 5 minutes, so the build's completion status is eventually recorded.","triggerScenarios":"start()/finish() call updateDistributed(); the writes to SystemDistributedKeyspace.successfulViewBuild or SystemKeyspace.setViewBuiltReplicated throw an Exception (e.g. the system_distributed keyspace/table unavailable, coordinator timeouts, consistency issues).","commonSituations":"system_distributed keyspace missing or having RF issues (common after misconfigured clusters or when RF exceeds available nodes); node cannot reach quorum for the status write; schema disagreements about system tables.","solutions":["Ensure the system_distributed keyspace exists with a replication factor achievable by the cluster (ALTER KEYSPACE system_distributed WITH replication = ...) and run repair on it","Wait for the automatic 5-minute retry — the status will be written once writes succeed","Check for schema disagreement (nodetool describecluster) and resolve it","Verify node connectivity and that all replicas for system_distributed are up"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// verify system_distributed keyspace before MV creation:\n// SELECT keyspace_name FROM system_schema.keyspaces WHERE keyspace_name='system_distributed';\n// ensure its RF <= number of DC-local nodes and it is repaired","typeGuard":null,"tryCatchPattern":"try {\n    updateDistributed();\n} catch (Exception e) {\n    // auto-retried after 5 minutes; fix system_distributed RF/connectivity in the meantime\n}","preventionTips":["Set system_distributed RF to match per-DC node counts and repair it regularly","Keep system_distributed keyspace present (it can be missing after some migrations)","Resolve schema disagreements promptly","Monitor write failures against system keyspaces"],"tags":["materialized-view","system-keyspace","retry","replication"],"backgroundTag":"view-build-failed","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"}