{"record":{"id":"4919974fb1b30217","repo":"risingwavelabs/risingwave","slug":"no-allow-alter-on-fly-fields-registered-for-connec-491997","errorCode":null,"errorMessage":"No allow_alter_on_fly fields registered for connection: {connection_name}","messagePattern":"No allow_alter_on_fly fields registered for connection: (.+?)","errorType":"validation","errorClass":"ConnectorError","httpStatus":null,"severity":"error","filePath":"src/connector/src/with_options_test.rs","lineNumber":828,"sourceCode":"        }}\n    }}\n    Ok(())\n}}\n\npub fn check_connection_allow_alter_on_fly_fields(\n    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],","sourceCodeStart":810,"sourceCodeEnd":846,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/with_options_test.rs#L810-L846","documentation":"Generated-code guard in check_connection_allow_alter_on_fly_fields: no allow_alter_on_fly whitelist is registered for the given connection type (CONNECTION_ALLOW_ALTER_ON_FLY_FIELDS has no entry), so any field-alteration request for this connection is rejected. Generic sentinel for unregistered connections.","triggerScenarios":"Calling check_connection_allow_alter_on_fly_fields for a known connection type whose allow-list was never generated, or when the generated registry is stale.","commonSituations":"New connection type added without updating the generator inputs; build cache missing freshly generated maps; connection type intentionally has no on-the-fly alterable fields but validation is called anyway.","solutions":["Re-run code generation to rebuild CONNECTION_ALLOW_ALTER_ON_FLY_FIELDS.","Register allow_alter_on_fly fields for the connection type if it should support them.","Skip this validation for connection types without registered fields."],"exampleFix":"// before\ncheck_connection_allow_alter_on_fly_fields(name, fields)?;\n// after\nif CONNECTION_ALLOW_ALTER_ON_FLY_FIELDS.contains_key(connection_name_to_prop_type_name(name).unwrap()) {\n    check_connection_allow_alter_on_fly_fields(name, fields)?;\n}","handlingStrategy":"type-guard","validationCode":"fn connection_has_alter_fields(name: &str) -> bool {\n    connection_name_to_prop_type_name(name)\n        .and_then(|t| CONNECTION_ALLOW_ALTER_ON_FLY_FIELDS.get(t))\n        .is_some()\n}","typeGuard":null,"tryCatchPattern":"if connection_has_alter_fields(name) {\n    check_connection_allow_alter_on_fly_fields(name, fields)?;\n}","preventionTips":["Regenerate code after adding connection types","Test that each registered connection type has a registry entry"],"tags":["connection","registry","generated-code"],"backgroundTag":"missing-required-config-field","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}