409
kafka
data_error
ai_generated
true
io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException:正在注册的模式与早期模式不兼容;错误代码:409
io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException: Schema being registered is incompatible with an earlier schema; error code: 409
ID: kafka/schema-registry-incompatible-schema
82%修复率
87%置信度
1证据数
2024-02-28首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| confluent-schema-registry 7.4.0 | active | — | — | — |
| confluent-schema-registry 7.5.0 | active | — | — | — |
| confluent-schema-registry 7.6.0 | active | — | — | — |
根因分析
正在注册的Avro或Protobuf模式违反了Schema Registry中配置的兼容性规则(例如BACKWARD、FORWARD)。
English
The Avro or Protobuf schema being registered violates the compatibility rules (e.g., BACKWARD, FORWARD) configured in Schema Registry.
官方文档
https://docs.confluent.io/platform/current/schema-registry/avro.html解决方案
-
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.
-
Temporarily set the subject's compatibility to BACKWARD_TRANSITIVE to allow evolution with defaults, then change back after registration.
无效尝试
常见但无效的做法:
-
70% 失败
Deleting schemas may break existing consumers that rely on the old schema, and Schema Registry may prevent deletion if subjects are referenced.
-
85% 失败
This disables schema evolution validation, which can lead to deserialization errors in production when consumers encounter unexpected fields.