{"record":{"id":"0bb61e1a52e23115","repo":"risingwavelabs/risingwave","slug":"field-field-is-not-allowed-to-be-altered-on-th-0bb61e","errorCode":null,"errorMessage":"Field '{field}' is not allowed to be altered on the fly for connection: {connection_name}","messagePattern":"Field '(.+?)' is not allowed to be altered on the fly for connection: (.+?)","errorType":"validation","errorClass":"ConnectorError","httpStatus":null,"severity":"error","filePath":"src/connector/src/allow_alter_on_fly_fields.rs","lineNumber":506,"sourceCode":"    connection_name: &str,\n    fields: &[String],\n) -> crate::error::ConnectorResult<()> {\n    use crate::source::connection_name_to_prop_type_name;\n\n    // Convert connection name to the type name key\n    let Some(type_name) = connection_name_to_prop_type_name(connection_name) else {\n        return Err(ConnectorError::from(anyhow::anyhow!(\n            \"Unknown connection: {connection_name}\"\n        )));\n    };\n    let Some(allowed_fields) = CONNECTION_ALLOW_ALTER_ON_FLY_FIELDS.get(type_name) else {\n        return Err(ConnectorError::from(anyhow::anyhow!(\n            \"No allow_alter_on_fly fields registered for connection: {connection_name}\"\n        )));\n    };\n    for field in fields {\n        if !allowed_fields.contains(field) {\n            return Err(ConnectorError::from(anyhow::anyhow!(\n                \"Field '{field}' is not allowed to be altered on the fly for connection: {connection_name}\"\n            )));\n        }\n    }\n    Ok(())\n}\n\n/// Checks if all given fields are allowed to be altered on the fly for the specified sink connector.\n/// Returns Ok(()) if all fields are allowed, otherwise returns a `ConnectorError`.\npub fn check_sink_allow_alter_on_fly_fields(\n    sink_name: &str,\n    fields: &[String],\n) -> crate::error::ConnectorResult<()> {\n    // TODO(#24846): JDBC sink currently uses `()` as sink config type in `for_all_sinks!`,\n    // so it cannot have an isolated key in `SINK_ALLOW_ALTER_ON_FLY_FIELDS`.\n    // Reuse the JDBC entry in `CONNECTION_ALLOW_ALTER_ON_FLY_FIELDS` for now.\n    // TODO(#24846): remove this special case after JDBC sink has a dedicated config type\n    // and allow-alter fields are generated directly into `SINK_ALLOW_ALTER_ON_FLY_FIELDS`.","sourceCodeStart":488,"sourceCodeEnd":524,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/allow_alter_on_fly_fields.rs#L488-L524","documentation":"Validation error from check_connection_allow_alter_on_fly_fields: while altering a connection's properties on the fly, the user requested changing field `field`, which is not in the per-connection-type whitelist (CONNECTION_ALLOW_ALTER_ON_FLY_FIELDS) for that connection. Only explicitly allow-listed fields may be altered without recreating the connection.","triggerScenarios":"ALTER CONNECTION attempting to change a field not present in CONNECTION_ALLOW_ALTER_ON_FLY_FIELDS for that connection type.","commonSituations":"Changing immutable connection properties (e.g. provider, service name) at runtime instead of only alterable ones like some endpoint/settings.","solutions":["Alter only allowlisted fields for the connection type","Drop and recreate the connection with the new values","Consult RW docs for the list of hot-alterable connection fields"],"exampleFix":"// before: ALTER CONNECTION c SET provider = 'aws'; -- not allowed\n// after: DROP CONNECTION c; CREATE CONNECTION c WITH (provider='aws', ...);","handlingStrategy":"validation","validationCode":"const CONNECTION_ALLOWED: &[&str] = &[\"endpoint\",\"settings\"]; // per-type allowlist\nif !CONNECTION_ALLOWED.contains(&field) {\n    return Err(format!(\"{field} is not hot-alterable\"));\n}","typeGuard":null,"tryCatchPattern":"match res {\n    Err(e) if e.to_string().contains(\"not allowed to be altered on the fly for connection\") => {\n        // fall back to DROP/CREATE CONNECTION\n    }\n    other => other?,\n}","preventionTips":["Only alter fields listed as hot-alterable for the connection type","Keep provider-level fields (provider, service name) immutable","Version-control connection definitions and apply changes via recreation"],"tags":["connection","validation","configuration"],"backgroundTag":"invalid-argument-value","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}