# io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException：正在注册的模式与早期模式不兼容；错误代码：409

- **ID:** `kafka/schema-registry-incompatible-schema`
- **领域:** kafka
- **类别:** data_error
- **错误码:** `409`
- **验证级别:** ai_generated
- **修复率:** 82%

## 根因

正在注册的Avro或Protobuf模式违反了Schema Registry中配置的兼容性规则（例如BACKWARD、FORWARD）。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| confluent-schema-registry 7.4.0 | active | — | — |
| confluent-schema-registry 7.5.0 | active | — | — |
| confluent-schema-registry 7.6.0 | active | — | — |

## 解决方案

1. ```
   Modify the new schema to be backward-compatible by adding fields with defaults, or by using the Schema Registry's compatibility checker via REST API to identify the incompatibility.
   ```
2. ```
   Temporarily set the subject's compatibility to BACKWARD_TRANSITIVE to allow evolution with defaults, then change back after registration.
   ```

## 无效尝试

- **** — Deleting schemas may break existing consumers that rely on the old schema, and Schema Registry may prevent deletion if subjects are referenced. (70% 失败率)
- **** — This disables schema evolution validation, which can lead to deserialization errors in production when consumers encounter unexpected fields. (85% 失败率)
