[
https://issues.apache.org/jira/browse/CASSSIDECAR-455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18125552#comment-18125552
]
Laxmikant Upadhyay edited comment on CASSSIDECAR-455 at 10/9/26 2:51 PM:
-------------------------------------------------------------------------
Hi Team,
While testing Cassandra Sidecar CDC with Cassandra Analytics 0.4.0, I
encountered a {{ClassCastException}} when processing CDC mutations containing
UDT columns.
This appears potentially related to the bridge/classloader changes addressed in
CASSSIDECAR-455.
h3. Question
Since CASSSIDECAR-455 already addresses Cassandra Analytics 0.4.0
bridge/classloader integration changes, could you please confirm whether this
issue falls within its scope?
*Should this be tracked as a new CASSSIDECAR JIRA bug, or would it be
appropriate to address it as part of CASSSIDECAR-455?*
h3. Environment
* Apache Cassandra 5.0
* Cassandra Sidecar trunk (0.5-SNAPSHOT)
* Cassandra Analytics 0.4.0
* CDC enabled with Kafka publishing
h3. Steps to Reproduce using docker compose cdc-demo
*1. Create a simple UDT*
{{CREATE TYPE IF NOT EXISTS cdc_demo.task_result (
status text,
message text
);}}
*2. Create a CDC-enabled table containing a list of frozen UDTs*
{{CREATE TABLE IF NOT EXISTS cdc_demo.task (
id uuid PRIMARY KEY,
name text,
results list<frozen<task_result>>
) WITH cdc = true;}}
*3. Insert a record containing the UDT collection*
{{INSERT INTO cdc_demo.task (
id,
name,
results
) VALUES (
11111111-1111-1111-1111-111111111111,
'test-task',
[
{
status: 'SUCCESS',
message: 'completed'
}
]
);}}
*4. Observe Sidecar CDC logs*
The CDC consumer detects the mutation and resolves the correct Kafka topic, but
fails while deserializing the {{results}} column.
{code:java}
{{ERROR CdcLogMode.java:166 - Failed to deserialize column value.
columnName=results
java.lang.ClassCastException: null
INFO CdcLogMode.java:104 - Processing CDC event.
kind=INSERT keyspace=cdc_demo table=task
partitionKeys=[id : 11111111-1111-1111-1111-111111111111]
clusteringKeys=null
valueColumns=[name : test-task], [results : unknown]
topic=cdc-mutations-cdc_demo-task
WARN CdcLogMode.java:113 - Skip publishing the event because it cannot be
serialized.}}
{code}
In a separate reproduction using a below schema, the exception included
additional classloader details:
{code:java}
– 1. Create transient_event UDT
CREATE TYPE IF NOT EXISTS cdc_demo.transient_event (
id uuid,
event_class text
);
– 2. Create execution_result UDT
CREATE TYPE IF NOT EXISTS cdc_demo.execution_result (
domain_event frozen<transient_event>,
status text
);
– 3. Create command table with CDC enabled
CREATE TABLE IF NOT EXISTS cdc_demo.command (
id uuid PRIMARY KEY,
command_class text,
execution_results list<frozen<execution_result>>
) WITH cdc = true;
{{INSERT INTO cdc_demo.task (
id,
name,
results
) VALUES (
11111111-1111-1111-1111-111111111111,
'test-task',
[
{
status: 'SUCCESS',
message: 'completed'
}
]
);}}
{{}}
{code}
{{you will observe:}}
{code:java}
{{java.lang.ClassCastException:
class org.apache.cassandra.spark.data.complex.CqlUdt
cannot be cast to
class org.apache.cassandra.spark.data.CqlType
(org.apache.cassandra.spark.data.complex.CqlUdt
is in unnamed module of loader
org.apache.cassandra.bridge.PostDelegationClassLoader @7b1655c3;
org.apache.cassandra.spark.data.CqlType
is in unnamed module of loader
org.apache.cassandra.bridge.PostDelegationClassLoader @38afe24f)}}
{code}
h3. Expected Behavior
CDC should successfully deserialize UDT column values and publish the mutation
to the configured Kafka topic.
Thanks!
was (Author: laxmikant99):
Hi Team,
While testing Cassandra Sidecar CDC with Cassandra Analytics 0.4.0, I
encountered a {{ClassCastException}} when processing CDC mutations containing
UDT columns.
This appears potentially related to the bridge/classloader changes addressed in
CASSSIDECAR-455.
h3. Question
Since CASSSIDECAR-455 already addresses Cassandra Analytics 0.4.0
bridge/classloader integration changes, could you please confirm whether this
issue falls within its scope?
*Should this be tracked as a new CASSSIDECAR JIRA bug, or would it be
appropriate to address it as part of CASSSIDECAR-455?*
h3. Environment
* Apache Cassandra 5.0
* Cassandra Sidecar trunk (0.5-SNAPSHOT)
* Cassandra Analytics 0.4.0
* CDC enabled with Kafka publishing
h3. Steps to Reproduce using docker compose cdc-demo
*1. Create a simple UDT*
{{CREATE TYPE IF NOT EXISTS cdc_demo.task_result (
status text,
message text
);}}
*2. Create a CDC-enabled table containing a list of frozen UDTs*
{{CREATE TABLE IF NOT EXISTS cdc_demo.task (
id uuid PRIMARY KEY,
name text,
results list<frozen<task_result>>
) WITH cdc = true;}}
*3. Insert a record containing the UDT collection*
{{INSERT INTO cdc_demo.task (
id,
name,
results
) VALUES (
11111111-1111-1111-1111-111111111111,
'test-task',
[
\{
status: 'SUCCESS',
message: 'completed'
}
]
);}}
*4. Observe Sidecar CDC logs*
The CDC consumer detects the mutation and resolves the correct Kafka topic, but
fails while deserializing the {{results}} column.
{{ERROR CdcLogMode.java:166 - Failed to deserialize column value.
columnName=results
java.lang.ClassCastException: null
INFO CdcLogMode.java:104 - Processing CDC event.
kind=INSERT keyspace=cdc_demo table=task
partitionKeys=[id : 11111111-1111-1111-1111-111111111111]
clusteringKeys=null
valueColumns=[name : test-task], [results : unknown]
topic=cdc-mutations-cdc_demo-task
WARN CdcLogMode.java:113 - Skip publishing the event because it cannot be
serialized.}}
In a separate reproduction using a below schema, the exception included
additional classloader details:
-- 1. Create transient_event UDT
CREATE TYPE IF NOT EXISTS cdc_demo.transient_event (
id uuid,
event_class text
);
-- 2. Create execution_result UDT
CREATE TYPE IF NOT EXISTS cdc_demo.execution_result (
domain_event frozen<transient_event>,
status text
);
-- 3. Create command table with CDC enabled
CREATE TABLE IF NOT EXISTS cdc_demo.command (
id uuid PRIMARY KEY,
command_class text,
execution_results list<frozen<execution_result>>
) WITH cdc = true;
{{INSERT INTO cdc_demo.task (
id,
name,
results
) VALUES (
11111111-1111-1111-1111-111111111111,
'test-task',
[
\{
status: 'SUCCESS',
message: 'completed'
}
]
);}}
{{}}
{{you will observe:}}
{{java.lang.ClassCastException:
class org.apache.cassandra.spark.data.complex.CqlUdt
cannot be cast to
class org.apache.cassandra.spark.data.CqlType
(org.apache.cassandra.spark.data.complex.CqlUdt
is in unnamed module of loader
org.apache.cassandra.bridge.PostDelegationClassLoader @7b1655c3;
org.apache.cassandra.spark.data.CqlType
is in unnamed module of loader
org.apache.cassandra.bridge.PostDelegationClassLoader @38afe24f)}}
h3. Expected Behavior
CDC should successfully deserialize UDT column values and publish the mutation
to the configured Kafka topic.
Thanks!
> Fix breaking changes for Analytics 0.4.0
> ----------------------------------------
>
> Key: CASSSIDECAR-455
> URL: https://issues.apache.org/jira/browse/CASSSIDECAR-455
> Project: Sidecar for Apache Cassandra
> Issue Type: Task
> Components: CDC
> Reporter: Jyothsna Konisa
> Priority: Major
> Fix For: 0.4
>
>
> Upgrades the Sidecar CDC integration to cassandra-analytics 0.4.0. Removes
> CdcAvroSerializer in favor of the library's built-in serialization via
> KafkaPublisher.create(). Updates CachingSchemaStore to store only the payload
> Avro schema in the cache and build the merged envelope schema on-the-fly at
> publish time. Fixes the PostDelegationClassLoader constructor signature
> change in CassandraBridgeFactory. Replaces the old
> ClientConfig/CdcSidecarInstancesProvider pattern with a @Singleton
> SidecarCdcClient in Guice, and removes the Cassandra 4.x version guard from
> integration tests as CDC 5.0 support has been added in analytics 0.4.0 version
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]