You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "hanmz (via GitHub)" <gi...@apache.org> on 2023/09/25 05:28:25 UTC
[GitHub] [pulsar] hanmz opened a new issue, #21242: [Bug] [geo-replication]
hanmz opened a new issue, #21242:
URL: https://github.com/apache/pulsar/issues/21242
### Search before asking
- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
### Version
2.9.2 and above versions
### Minimal reproduce step
1、create topic [test-tenant/test-ns/test-topic] in cluster-1 and cluster-2
2、send message by producer use Schema.JSON(String.class) in cluster-1
3、start geo-replication from cluster-2 to cluster-1
4、We will encounter the following exception in cluster-2 broker log

### What did you expect to see?
No exceptions and geo-replicator working normally.
### What did you see instead?
Encountered an exception and was unable to normal work.
### Anything else?
These two questions are similar: https://github.com/apache/pulsar/issues/21241
In AbstractReplicator class, a possible solution is to replace Schema.AUTO_PRODUCE_BYTES() with Schema.BYTES?
### Are you willing to submit a PR?
- [X] I'm willing to submit a PR!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] [geo-replication] Failed to create remote producer (org.apache.avro.AvroRuntimeException: Not a record: "string") [pulsar]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #21242:
URL: https://github.com/apache/pulsar/issues/21242#issuecomment-1782163823
The issue had no activity for 30 days, mark with Stale label.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] [geo-replication] Failed to create remote producer (org.apache.avro.AvroRuntimeException: Not a record: "string") [pulsar]
Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat commented on issue #21242:
URL: https://github.com/apache/pulsar/issues/21242#issuecomment-6381718892
Confirmed on current master. The replicator creates its producer on the remote cluster with `Schema.AUTO_PRODUCE_BYTES()` (`pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractReplicator.java` line 153). The client then loads the remote topic's schema through `Schema.getSchema()` (`PulsarClientImpl.reloadSchemaForAutoProduceProducer`, line 859). For a JSON schema this builds a `GenericSchemaImpl` (`AutoConsumeSchema.java` line 260), and its constructor calls Avro `getFields()`, which throws for a non-record schema such as the `"string"` produced by `Schema.JSON(String.class)` (`GenericSchemaImpl.java` lines 43-52). The broker still accepts such JSON schemas: #24103 only rejects non-record schemas of type AVRO (`StructSchemaDataValidator.java` line 66). Likely fix: have the auto-produce path skip generic-record validation for non-record JSON schemas (or have the replicator not depend on it), so a primitive JSON schema no longer fails producer creation. #21241 is th
e same root cause on the consumer side.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org