{"record":{"id":"f17260e93316ff8b","repo":"apache/cassandra","slug":"cannot-run-incremental-repair-while-materialized-v","errorCode":null,"errorMessage":"Cannot run incremental repair while materialized view replay is enabled. Set materialized_views_on_repair_enabled to false.","messagePattern":"Cannot run incremental repair while materialized view replay is enabled\\. Set materialized_views_on_repair_enabled to false\\.","errorType":"exception","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/AutoRepairService.java","lineNumber":80,"sourceCode":"    {\n        MBeanWrapper.instance.registerMBean(instance, MBEAN_NAME);\n    }\n\n    public void checkCanRun(String repairType)\n    {\n        checkCanRun(RepairType.parse(repairType));\n    }\n\n    public void checkCanRun(RepairType repairType)\n    {\n        if (!config.isAutoRepairSchedulingEnabled())\n            throw new ConfigurationException(\"Auto-repair scheduler is disabled.\");\n\n        if (repairType != RepairType.INCREMENTAL)\n            return;\n\n        if (config.getMaterializedViewRepairEnabled(repairType) && DatabaseDescriptor.isMaterializedViewsOnRepairEnabled())\n            throw new ConfigurationException(\"Cannot run incremental repair while materialized view replay is enabled. Set materialized_views_on_repair_enabled to false.\");\n\n        if (DatabaseDescriptor.isCDCEnabled() && DatabaseDescriptor.isCDCOnRepairEnabled())\n            throw new ConfigurationException(\"Cannot run incremental repair while CDC replay is enabled. Set cdc_on_repair_enabled to false.\");\n    }\n\n    public AutoRepairConfig getAutoRepairConfig()\n    {\n        return config;\n    }\n\n    @Override\n    public boolean isAutoRepairDisabled()\n    {\n        return config == null || !config.isAutoRepairSchedulingEnabled();\n    }\n\n    @Override\n    public String getAutoRepairConfiguration()","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/AutoRepairService.java#L62-L98","documentation":"For incremental repair, checkCanRun rejects configurations where materialized-view repair and materialized_views_on_repair_enabled are both on, since MV replay during incremental repair is unsupported. It throws ConfigurationException with instructions to disable materialized_views_on_repair_enabled.","triggerScenarios":"Calling checkCanRun(RepairType.INCREMENTAL) when config.getMaterializedViewRepairEnabled(INCREMENTAL) is true AND DatabaseDescriptor.isMaterializedViewsOnRepairEnabled() is true.","commonSituations":"Clusters with materialized views that also enable MV-on-repair; operators switching repair type to incremental without revisiting MV replay settings.","solutions":["Set materialized_views_on_repair_enabled: false in cassandra.yaml","Or use a non-incremental repair type (full repair) if MV replay must stay enabled","Or disable materialized view repair for the incremental repair type"],"exampleFix":"// cassandra.yaml\n// before\nmaterialized_views_on_repair_enabled: true\n// after\nmaterialized_views_on_repair_enabled: false","handlingStrategy":"validation","validationCode":"if (repairType == RepairType.INCREMENTAL\n    && config.getMaterializedViewRepairEnabled(RepairType.INCREMENTAL)\n    && org.apache.cassandra.config.DatabaseDescriptor.isMaterializedViewsOnRepairEnabled())\n    throw new IllegalStateException(\"Disable materialized_views_on_repair_enabled before incremental repair\");\nautoRepairService.checkCanRun(repairType);","typeGuard":null,"tryCatchPattern":"try { autoRepairService.checkCanRun(RepairType.INCREMENTAL); } catch (ConfigurationException e) { logger.warn(\"Incremental repair blocked: {}\", e.getMessage()); }","preventionTips":["Audit MV-related settings whenever switching repair type to incremental","Prefer full repair when MV replay must stay enabled","Keep cassandra.yaml settings reviewed together as a set (MV, CDC, repair)"],"tags":["repair","configuration","materialized-views"],"backgroundTag":"conflicting-config-options","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"}