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 7106c0d7a592d..459e6687e1275 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,7 +230,11 @@ public CompletableFuture putSchemaIfAbsent(String schemaId, Schem }))).whenComplete((v, ex) -> { var latencyMs = this.clock.millis() - start.longValue(); if (ex != null) { - log.error("[{}] Put schema failed", schemaId, ex); + 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); } @@ -458,7 +462,7 @@ private CompletableFuture checkCompatibilityWithLatest(String schemaId, Sc CompletableFuture 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 @@ private CompletableFuture checkCompatibilityWithAll(String schemaId, Schem 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()) {