You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2026/04/15 13:23:48 UTC
(pulsar) 05/07: [fix][broker] Change the schema incompatible log from ERROR to WARN level (#25483)
This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch branch-4.2
in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit 2d9ce2b45cdb6680036726c943f9bc4def7232fe
Author: Jiwei Guo <te...@apache.org>
AuthorDate: Wed Apr 8 16:34:47 2026 +0800
[fix][broker] Change the schema incompatible log from ERROR to WARN level (#25483)
(cherry picked from commit 0b73b3a346c3f6c66107123f73bc098b53b0113d)
---
.../broker/service/schema/SchemaRegistryServiceImpl.java | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryServiceImpl.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryServiceImpl.java
index b722a2df258..a5b6bd88408 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryServiceImpl.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/schema/SchemaRegistryServiceImpl.java
@@ -230,8 +230,12 @@ public class SchemaRegistryServiceImpl implements SchemaRegistryService {
}))).whenComplete((v, ex) -> {
var latencyMs = this.clock.millis() - start.getValue();
if (ex != null) {
- log.error("[{}] Put schema failed", schemaId, ex);
- if (start.getValue() != 0) {
+ if (ex instanceof IncompatibleSchemaException) {
+ log.warn("[{}] Put schema failed due to incompatible schema", schemaId, ex);
+ } else {
+ log.error("[{}] Put schema failed", schemaId, ex);
+ }
+ if (start.longValue() != 0) {
this.stats.recordPutFailed(schemaId, latencyMs);
}
promise.completeExceptionally(ex);
@@ -458,7 +462,7 @@ public class SchemaRegistryServiceImpl implements SchemaRegistryService {
CompletableFuture<Void> result = new CompletableFuture<>();
result.whenComplete((__, t) -> {
if (t != null) {
- log.error("[{}] Schema is incompatible", schemaId);
+ log.warn("[{}] Schema is incompatible", schemaId);
this.stats.recordSchemaIncompatible(schemaId);
} else {
if (log.isDebugEnabled()) {
@@ -495,7 +499,7 @@ public class SchemaRegistryServiceImpl implements SchemaRegistryService {
result.whenComplete((v, t) -> {
if (t != null) {
this.stats.recordSchemaIncompatible(schemaId);
- log.error("[{}] Schema is incompatible, schema type {}", schemaId, schema.getType());
+ log.warn("[{}] Schema is incompatible, schema type {}", schemaId, schema.getType());
} else {
this.stats.recordSchemaCompatible(schemaId);
if (log.isDebugEnabled()) {