{"record":{"id":"5f5dcb512cf02c59","repo":"apache/cassandra","slug":"not-adding-view-because-the-base-table-is-un","errorCode":null,"errorMessage":"Not adding view {} because the base table {} is unknown","messagePattern":"Not adding view (.+?) because the base table (.+?) is unknown","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/db/view/ViewManager.java","lineNumber":176,"sourceCode":"            logger.info(\"Not submitting build tasks for views in keyspace {} as \" +\n                        \"storage service is not initialized\", keyspace.getName());\n            return;\n        }\n\n        for (View view : allViews())\n        {\n            view.build();\n            // We provide the new definition from the base metadata\n            view.updateDefinition(newViewsByName.get(view.name));\n        }\n    }\n\n    public void addView(ViewMetadata definition)\n    {\n        // Skip if the base table doesn't exist due to schema propagation issues, see CASSANDRA-13737\n        if (!keyspace.hasColumnFamilyStore(definition.baseTableId))\n        {\n            logger.warn(\"Not adding view {} because the base table {} is unknown\",\n                        definition.name(),\n                        definition.baseTableId);\n            return;\n        }\n\n        View view = new View(definition, keyspace.getColumnFamilyStore(definition.baseTableId));\n        forTable(keyspace.getMetadata().tables.getNullable(view.getDefinition().baseTableId)).add(view);\n        viewsByName.put(definition.name(), view);\n    }\n\n    /**\n     * Stops the building of the specified view, no-op if it isn't building.\n     *\n     * @param name the name of the view\n     */\n    public void dropView(String name)\n    {\n        View view = viewsByName.remove(name);","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/view/ViewManager.java#L158-L194","documentation":"ViewManager.addView() registers a materialized view with its keyspace, but needs the base table's ColumnFamilyStore to exist locally. Due to schema propagation timing (CASSANDRA-13737), the view definition can arrive before its base table; in that case the view is skipped with this warning. ViewManager.reload()/update schemes re-add the view later once the base table appears.","triggerScenarios":"addView(definition) is invoked during schema reload while keyspace.hasColumnFamilyStore(definition.baseTableId) is false — the view's schema row arrived before the base table's schema row.","commonSituations":"Schema changes racing across the cluster (view created moments before base table row is applied locally); restoring schema partially; multi-DC clusters with slow schema propagation; CASSANDRA-13737-class timing issues.","solutions":["No action needed if transient: the next schema reload adds the view once the base table exists — verify with a schema describe","Force a schema refresh (nodetool reload with schema round) or restart the node if the view remains missing","Check schema agreement across nodes (nodetool describecluster) and repair system_schema on lagging nodes","If persistently missing, recreate the materialized view after confirming the base table exists everywhere"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// after creating an MV, verify registration on every node:\n// nodetool describecluster (schema agreement)\n// confirm base table exists: DESC KEYSPACE <ks>;","typeGuard":null,"tryCatchPattern":"if (!keyspace.hasColumnFamilyStore(baseTableId)) {\n    // view will be added on next schema reload; verify it appears\n    // otherwise restart node / refresh schema\n}","preventionTips":["Verify the view exists on all nodes after creation (DESC KEYSPACE)","Force a schema refresh or restart nodes where the view was skipped","Keep schema changes isolated from restarts and topology churn","Repair system_schema on any node showing disagreement"],"tags":["materialized-view","schema-propagation","gossip"],"backgroundTag":"schema-propagation-lag","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}