Skip to content

Conversation

@coderzc
Copy link
Member

@coderzc coderzc commented Dec 9, 2025

Motivation

Since broker sent ErrorResponse to client when adding schema failed, so broker side only need to print warn log to help to troubleshoot the problem.

Modifications

The log level is changed from error to warn, and the conditional check for IncompatibleSchemaException is removed, so all failures are now logged as warnings.

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Dec 9, 2025
remoteAddress,
topicName, producerId, exception);
}
log.warn("Try add schema failed, remote address {}, topic {}, producerId {}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the client-side makes a mistake, which registrers a incompatible schema, we should not print any warn log for it. In other words, IncompatibleSchemaException should be ignored

Copy link
Member Author

@coderzc coderzc Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If IncompatibleSchemaException should be ignored, then what about InvalidSchemaDataException? Does it also need to be ignored?

e.g

org.apache.pulsar.broker.service.schema.exceptions.InvalidSchemaDataException: Invalid schema definition data for PROTOBUF schema
	at org.apache.pulsar.broker.service.schema.validator.StructSchemaDataValidator.throwInvalidSchemaDataException(StructSchemaDataValidator.java:98)
	at org.apache.pulsar.broker.service.schema.validator.StructSchemaDataValidator.validate(StructSchemaDataValidator.java:69)
	at org.apache.pulsar.broker.service.schema.validator.SchemaDataValidator.validateSchemaData(SchemaDataValidator.java:46)
	at org.apache.pulsar.broker.service.schema.validator.SchemaRegistryServiceWithSchemaDataValidator.putSchemaIfAbsent(SchemaRegistryServiceWithSchemaDataValidator.java:92)
	at org.apache.pulsar.broker.service.AbstractTopic.addSchema(AbstractTopic.java:729)
	at org.apache.pulsar.broker.service.ServerCnx.tryAddSchema(ServerCnx.java:3185)
	at org.apache.pulsar.broker.service.ServerCnx.lambda$handleProducer$32(ServerCnx.java:1721)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignored InvalidSchemaDataException @poorbarcode

@coderzc coderzc requested a review from poorbarcode December 11, 2025 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants