You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Josh McKenzie (Jira)" <ji...@apache.org> on 2026/07/20 18:07:00 UTC
[jira] [Updated] (CASSANALYTICS-184) CdcState.ReplicaCountSerializer map-size overflow corrupts persisted CDC state
[ https://issues.apache.org/jira/browse/CASSANALYTICS-184?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Josh McKenzie updated CASSANALYTICS-184:
----------------------------------------
Reviewers: Josh McKenzie
> CdcState.ReplicaCountSerializer map-size overflow corrupts persisted CDC state
> ------------------------------------------------------------------------------
>
> Key: CASSANALYTICS-184
> URL: https://issues.apache.org/jira/browse/CASSANALYTICS-184
> Project: Apache Cassandra Analytics
> Issue Type: Bug
> Reporter: Jyothsna Konisa
> Priority: Normal
> Time Spent: 10m
> Remaining Estimate: 0h
>
> CdcState.ReplicaCountSerializer serializes the number of entries in the CDC watermarker's replica-count map (numUpdates — the count of distinct mutations awaiting sufficient replica acknowledgment) using a signed short (max 32,767), this silently overflows once the map grows past that sizeOnce corrupted. The bad size gets persisted to Cassandra via SidecarStatePersister and re-read on every subsequent restart, causing a permanent crash loop.
> message="Failed to start CDC consumers, cleaning up resources"
> exception=java.lang.IllegalArgumentException: Illegal initial capacity: -4366
> at java.util.HashMap.<init>
> at org.apache.cassandra.cdc.state.CdcState$ReplicaCountSerializer.read(CdcState.java:404)
> at org.apache.cassandra.cdc.state.CdcState$Serializer.read(CdcState.java:380)
> at org.apache.cassandra.cdc.Cdc.start(Cdc.java:137)
> -4366 is the short-overflow wraparound of a map size that grew past 32,767 under sustained backpressure (CDC write-rejection storms inflating the watermarker as mutations piled up waiting for replica quorum). The corrupted size persists indefinitely — each restart re-reads the same broken state and crashes identically, with no self-heal.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org