rdhabalia commented on a change in pull request #9212:
URL: https://github.com/apache/pulsar/pull/9212#discussion_r559935295
##########
File path:
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/ClientGetSchemaTest.java
##########
@@ -104,4 +113,62 @@ public void testGetSchema(String serviceUrl) throws
Exception {
assertEquals(client.getSchema(topicAvro).join(),
Optional.of(Schema.AVRO(MyClass.class).getSchemaInfo()));
}
+ /**
+ * It validates if schema ledger is deleted or non recoverable then it
will clean up schema storage for the topic
+ * and make the topic available.
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testSchemaFailure() throws Exception {
+ final String tenant = PUBLIC_TENANT;
+ final String namespace = "test-namespace-" + randomName(16);
+ final String topicOne = "test-broken-schema-storage";
+ final String fqtnOne = TopicName.get(TopicDomain.persistent.value(),
tenant, namespace, topicOne).toString();
+
+ admin.namespaces().createNamespace(tenant + "/" + namespace,
Sets.newHashSet("test"));
+
+ // (1) create topic with schema
+ Producer<Schemas.PersonTwo> producer = pulsarClient
+ .newProducer(Schema.AVRO(SchemaDefinition.<Schemas.PersonTwo>
builder().withAlwaysAllowNull(false)
+
.withSupportSchemaVersioning(true).withPojo(Schemas.PersonTwo.class).build()))
+ .topic(fqtnOne).create();
+
+ producer.close();
+
+ String key = TopicName.get(fqtnOne).getSchemaName();
+ BookkeeperSchemaStorage schemaStrogate = (BookkeeperSchemaStorage)
pulsar.getSchemaStorage();
Review comment:
fixed it.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]