Illustration Image

No CDC data in Cassandra binary logs (cdc_raw)

I encountered an issue while using CDC in Cassandra and need your help to resolve it.

I have set up a Change Data Capture (CDC) system to track changes in a specific table. CDC is enabled, and I can see that binary logs are being created in the cdc_raw directory. However, I noticed that the data modify (insert new records, update existing ones, or delete records) in this table does not appear in the cdc_raw logs. That is, the logs remain empty.

For reading CDC binary logs (cdc_raw), I rely on a pre-built .jar file that implements the Java class CommitLogReader.java

Below is my sequence of steps:

1 Installed Cassandra 4.1.8 in Docker

2 Set the variables in the file /etc/cassandra/cassandra.yaml

cdc_enabled: true

cdc_raw_directory: /var/lib/cassandra/cdc_raw

commitlog_directory: /var/lib/cassandra/commitlog

cdc_total_space: 4096MiB

cdc_free_space_check_interval: 250ms

3 Created a keyspace demo

CREATE KEYSPACE demo WITH REPLICATION = { 'class' : 'org.apache.cassandra.locator.SimpleStrategy', 'replication_factor': '3' };

4 Created a table demo.my_table_cdc_text

CREATE TABLE demo.my_table_cdc_text(
    id int,
    code text,
    first_name text,
    last_name text,
    email text,
    PRIMARY KEY(id, code)
)
WITH cdc=true;

5 Added data to the table demo.my_table_cdc_text (350 rows)

BEGIN batch
    INSERT INTO demo.my_table_cdc_text (id, code, email, first_name, last_name) VALUES(769, 'brown fox jumps over t', 'Joelle.Stuart.11@yahoo.in', 'Abraham', 'Douglas');
    INSERT INTO demo.my_table_cdc_text (id, code, email, first_name, last_name) VALUES(769, 'dogThe quick brown fox jumps ove', 'Calvin.Haines.02@hetnet.nl', 'Oscar', 'Jeremy');
    INSERT INTO demo.my_table_cdc_text (id, code, email, first_name, last_name) VALUES(769, 'dogThe quick brown fox jumps over t', 'Mercedes.Pippen.46@yahoo.es', 'Maggie', 'Roberta');
    .........
    INSERT INTO demo.my_table_cdc_text (id, code, email, first_name, last_name) VALUES(769, 'fox jumps over', 'Teresa.Plumb.84@laposte.net', 'Ida', 'Tamara');
    INSERT INTO demo.my_table_cdc_text (id, code, email, first_name, last_name) VALUES(769, 'fox jumps over the lazy dogThe quick bro', 'Hodierna.Nicol.73@terra.com.br', 'Rich', 'Beatrice');
apply batch;

P.S: I also tried these parameters and commands:

  • changed the log_segment_size parameter from 32MiB to 1Mib;
  • run command: nodetool flush demo my_table_cdc_text
Become part of our
growing community!
Welcome to Planet Cassandra, a community for Apache Cassandra®! We're a passionate and dedicated group of users, developers, and enthusiasts who are working together to make Cassandra the best it can be. Whether you're just getting started with Cassandra or you're an experienced user, there's a place for you in our community.
A dinosaur
Planet Cassandra is a service for the Apache Cassandra® user community to share with each other. From tutorials and guides, to discussions and updates, we're here to help you get the most out of Cassandra. Connect with us and become part of our growing community today.
© 2009-2023 The Apache Software Foundation under the terms of the Apache License 2.0. Apache, the Apache feather logo, Apache Cassandra, Cassandra, and the Cassandra logo, are either registered trademarks or trademarks of The Apache Software Foundation. Sponsored by Anant Corporation and Datastax, and Developed by Anant Corporation.

Get Involved with Planet Cassandra!

We believe that the power of the Planet Cassandra community lies in the contributions of its members. Do you have content, articles, videos, or use cases you want to share with the world?