GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [fix][test] Fix ServerCnxTest.testSendWithoutSchemaVersionFromAutoProduceBytesProducer failing since #27314 by merlimat · Pull Request #27331 · apache/pulsar

Conversation

@merlimat

@merlimat merlimat commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Motivation

#27312 and #27314 changed the same check in Producer.checkAndStartPublish, and their hunks don't overlap, so they merged one after the other without a conflict:

  • [fix][broker] Fail a schema-less AUTO_PRODUCE_BYTES send at once instead of retrying it until the send timeout #27312 made the broker reject a message without a schema version from an AUTO_PRODUCE_BYTES producer with NotAllowedError, kept MetadataError for replicator producers, and added ServerCnxTest.testSendWithoutSchemaVersionFromAutoProduceBytesProducer with a case for each.
  • [fix][broker] Fix replication stuck on a schema-less message to a remote topic with an enforced schema #27314 then took replicator producers out of the check altogether, so the broker accepts their messages.

With both on master, the replicator case gets a send receipt instead of an error. The test has failed in every CI - Unit - Brokers - Broker Group 1 run since #27314 merged:

ServerCnxTest > testSendWithoutSchemaVersionFromAutoProduceBytesProducer[4](pulsar.repl.remote-cluster, MetadataError) FAILED
    java.lang.ClassCastException: class org.apache.pulsar.common.api.proto.CommandSendReceipt cannot be cast to class org.apache.pulsar.common.api.proto.CommandSendError
        at org.apache.pulsar.broker.service.ServerCnxTest.testSendWithoutSchemaVersionFromAutoProduceBytesProducer(ServerCnxTest.java:3472)

The replicator branch #27312 added to the error code can't be reached either, since the check now only runs for producers that aren't replicators:

if (isAutoProduceBytes && requiresSchemaVersion && !isRemoteOrShadow && ...) {
    ...
    ServerError error = isRemoteOrShadow ? ServerError.MetadataError : ServerError.NotAllowedError;

Modifications

  • Producer.checkAndStartPublish sends NotAllowedError directly, and its comment no longer says that replicators get MetadataError.
  • testSendWithoutSchemaVersionFromAutoProduceBytesProducer checks only the regular producer now, so its data provider is gone. [fix][broker] Fix replication stuck on a schema-less message to a remote topic with an enforced schema #27314's OneWayReplicatorSchemaValidationEnforcedTest.testReplicationOfSchemaLessMessagesToRemoteTopicWithSchema covers the replicator side: those messages replicate to a topic that enforces its schema.

The broker behaves the same as before. Any release branch that gets both #27312 and #27314 needs this change too.

Verifying this change

  • Make sure that the change passes the CI checks.

This change is already covered by existing tests, such as ServerCnxTest, which passes locally (172 tests), including testSendWithoutSchemaVersionFromAutoProduceBytesProducer.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@merlimat
[fix][test] Fix ServerCnxTest.testSendWithoutSchemaVersionFromAutoPro…
dcbb858
…duceBytesProducer failing since apache#27314

apache#27312 kept MetadataError for replicator producers and tested it, and
apache#27314 then took replicator producers out of the schema-version check,
so the broker now accepts their messages and the replicator case gets a
send receipt. Remove that case and the replicator branch of the error
code, which can no longer be reached.
@merlimat merlimat added the area/test label Nov 3, 2026
@merlimat
merlimat requested a review from codelipenghui November 3, 2026 16:32
@merlimat merlimat added this to the 5.1.0 milestone Nov 3, 2026
@merlimat merlimat mentioned this pull request Nov 3, 2026
[improve][test] Speed up four Broker Group 1 test classes #27334
Merged
10 tasks
@merlimat
merlimat requested a review from lhotari November 3, 2026 18:08
lhotari
lhotari approved these changes Nov 3, 2026
View reviewed changes
codelipenghui
codelipenghui approved these changes Nov 3, 2026
View reviewed changes

@codelipenghui codelipenghui left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Reviewed commit dcbb858.

No actionable findings identified within the reviewed scope.

Reproduced the parent-source ClassCastException; the patched connection test and broker/topic schema-enforcement tests passed. The two-cluster replication test could not reach publishing because local disk usage exceeded BookKeeper's threshold, making its bookies read-only.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@merlimat
merlimat merged commit 86efc14 into apache:master Nov 3, 2026
44 checks passed

Uh oh!

There was an error while loading. Please reload this page.

lhotari pushed a commit that referenced this pull request Nov 4, 2026
@merlimat @lhotari
[fix][test] Fix ServerCnxTest.testSendWithoutSchemaVersionFromAutoPro…
4722764
…duceBytesProducer failing since #27314 (#27331)

(cherry picked from commit 86efc14)
@lhotari lhotari added release/5.0.2 cherry-picked/branch-5.0 labels Nov 4, 2026
@merlimat merlimat mentioned this pull request Nov 5, 2026
[improve][ci] Trigger Netty leak detection once per test class instead of after every test method #27376
Merged
11 tasks
This was referenced Nov 21, 2026
[improve][ci] Run CI for the 4.2.6 backports to branch-4.2 (do not merge) #27680
Closed
[improve][ci] Run CI for the 4.2.6 backports to branch-4.2 (do not merge) #27681
Closed
[improve][ci] Run CI for the 4.2.6 backports to branch-4.2 (do not merge) #27684
Closed
@lhotari lhotari added cherry-picked/branch-4.2 release/4.2.6 cherry-picked/branch-4.0 release/4.0.15 labels Nov 21, 2026
poorbarcode pushed a commit to poorbarcode/pulsar that referenced this pull request Nov 26, 2026
@merlimat @lhotari
[fix][test] Fix ServerCnxTest.testSendWithoutSchemaVersionFromAutoPro…
5335881
…duceBytesProducer failing since apache#27314 (apache#27331)

(cherry picked from commit 86efc14)
poorbarcode pushed a commit to poorbarcode/pulsar that referenced this pull request Nov 26, 2026
@merlimat @lhotari
[fix][test] Fix ServerCnxTest.testSendWithoutSchemaVersionFromAutoPro…
fe7ad8e
…duceBytesProducer failing since apache#27314 (apache#27331)

(cherry picked from commit 86efc14)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@lhotari lhotari lhotari approved these changes
@codelipenghui codelipenghui codelipenghui approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

area/test cherry-picked/branch-4.0 cherry-picked/branch-4.2 cherry-picked/branch-5.0 release/4.0.15 release/4.2.6 release/5.0.2

Projects

None yet

Milestone

5.1.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@merlimat @lhotari @codelipenghui
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.