{"record":{"id":"cd73903132e05fb0","repo":"influxdata/influxdb","slug":"node-node-id-has-compact-mode-and-cannot-be-removed","errorCode":null,"errorMessage":"node '{node_id}' has compact mode and cannot be removed","messagePattern":"node '(.+?)' has compact mode and cannot be removed","errorType":"error_code","errorClass":"CatalogError","httpStatus":null,"severity":"error","filePath":"influxdb3_catalog/src/error.rs","lineNumber":308,"sourceCode":"\n    #[error(\"cannot delete internal db\")]\n    CannotDeleteInternalDatabase,\n\n    #[error(\"cannot modify internal db\")]\n    CannotModifyInternalDatabase,\n\n    #[error(\"tried to stop a node ({node_id}) that is already stopped\")]\n    NodeAlreadyStopped { node_id: Arc<str> },\n\n    #[error(\n        \"node '{node_id}' is not fully stopped (current state: {current_state}); run \\\"stop node\\\" first\"\n    )]\n    NodeNotFullyStopped {\n        node_id: Arc<str>,\n        current_state: &'static str,\n    },\n\n    #[error(\"node '{node_id}' has compact mode and cannot be removed\")]\n    NodeModeNotRemovable { node_id: Arc<str> },\n\n    #[error(\"invalid stop ack for node '{node_id}' (current state: {current_state})\")]\n    InvalidStopAck {\n        node_id: Arc<str>,\n        current_state: &'static str,\n    },\n\n    #[error(\"invalid unregister for node '{node_id}' (current state: {current_state})\")]\n    InvalidUnregister {\n        node_id: Arc<str>,\n        current_state: &'static str,\n    },\n\n    #[error(\"idempotent no-op\")]\n    IdempotentNoOp,\n\n    #[error(\"cannot delete operator token\")]","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_catalog/src/error.rs#L290-L326","documentation":"This error is thrown when an operator attempts to remove a node from the cluster catalog while the node is still configured with a compactor mode. Removing a node that owns compaction work would leave compacted generations unproduced, so the catalog refuses the operation. It is raised by node lifecycle/registration APIs in the catalog.","triggerScenarios":"Calling the catalog's node removal/unregister API (Catalog::remove_node / node state machine transitions) with a node_id whose current NodeMode/role includes compact duties.","commonSituations":"Decommissioning a node during cluster resize or failover; automated scripts draining nodes that happen to be compactor-enabled; operator removes a node via admin CLI/HTTP API without first stripping its compact role.","solutions":["Reconfigure the node so its mode no longer includes compaction (remove compact role), then retry removal.","Verify the node has been fully stopped and drained of compactor responsibilities with the node state/inspect API.","If the node id is wrong, re-run the removal targeting the intended node_id.","If compaction has been migrated elsewhere (e.g. another compactor node), confirm the catalog reflects the new assignment before removing."],"exampleFix":"// before\ncatalog.remove_node(\"compactor-01\").await?;\n// after\nlet node = catalog.node(\"compactor-01\")?;\nassert!(!node.mode.is_compactor(), \"strip compact role before removal\");\ncatalog.set_node_mode(\"compactor-01\", NodeMode::QueryOnly)?;\ncatalog.remove_node(\"compactor-01\").await?;","handlingStrategy":"validation","validationCode":"let node = catalog.node(node_id)?;\nif node.mode.is_compactor() {\n    return Err(format!(\"node {node_id} still has compact mode; strip role before removal\"));\n}","typeGuard":"fn removable(node: &NodeMetadata) -> bool { !matches!(node.mode, NodeMode::Compact | NodeMode::All) }","tryCatchPattern":null,"preventionTips":["Inspect node mode before any removal call","Standardize a decommission runbook: drain -> stop -> strip roles -> remove","Gate node-removal automation on node state checks"],"tags":["cluster","node-lifecycle","catalog"],"backgroundTag":"invalid-state-transition","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}