jyothsnakonisa commented on code in PR #347:
URL: https://github.com/apache/cassandra-sidecar/pull/347#discussion_r3268558430
##########
server/src/main/java/org/apache/cassandra/sidecar/cdc/CachingSchemaStore.java:
##########
@@ -176,17 +209,26 @@ void onSchemaChanged()
tableHistoryDatabaseAccessor.insertTableSchemaHistory(cqlTable.keyspace(),
cqlTable.table(), cqlTable.createStatement());
}
LOGGER.info("Re-generating Avro Schema after schema change
keyspace={} table={}", tableIdentifier.keyspace(), tableIdentifier.table());
- return new SchemaCacheEntry(cqlTable,
cqlToAvroSchemaConverter);
+ return new SchemaCacheEntry(cqlTable,
cqlToAvroSchemaConverter.convert(cqlTable));
}
return v;
});
}
- loadPublisher();
- publishSchemas();
+ try
+ {
+ loadPublisher();
+ publishSchemas();
+ }
+ catch (Exception e)
+ {
+ LOGGER.error("Failed to publish schemas to Kafka, CDC will still
start", e);
+ }
// Remove any old schema entries for deleted tables, this operation
can be done in the end as this is
// only for removing stale entries and no one is going to use these
entries once the table is removed.
// This doesn't have to be an atomic operation.
-
avroSchemasCache.keySet().retainAll(refreshedCdcTables.stream().map(cqlTable ->
TableIdentifier.of(cqlTable.keyspace(),
cqlTable.table())).collect(Collectors.toList()));
+ avroSchemasCache.keySet().retainAll(refreshedCdcTables.stream()
+ .map(cqlTable
-> TableIdentifier.of(cqlTable.keyspace(), cqlTable.table()))
+
.collect(Collectors.toList()));
vertx.eventBus().publish(ON_CDC_CACHE_WARMED_UP.address(), "Cdc cache
warmed up");
Review Comment:
Added comment.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]