Skip to content

fix: Skip Cassandra rows whose TTL exceeds the 20-year maximum#367

Open
Manisha4 wants to merge 1 commit into
masterfrom
fix-cassandra-limit
Open

fix: Skip Cassandra rows whose TTL exceeds the 20-year maximum#367
Manisha4 wants to merge 1 commit into
masterfrom
fix-cassandra-limit

Conversation

@Manisha4

@Manisha4 Manisha4 commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it:

A SortedFeatureView row with a far-future event_timestamp produces a per-row TTL above Cassandra's 20-year cap (630,720,000s). Because the TTL is inlined into the CQL statement, session.prepare() rejects it ("ttl is too large" / "Unable to make int from ..."). That exception is raised during batch construction, bypasses the async on_failure handler, and aborts the entire micro-batch — stalling a stream indefinitely on a single bad record (the checkpoint can never advance past the poison row).

Add a CASSANDRA_MAX_TTL guard mirroring the existing 'ttl < 0' skip: oversized-TTL rows are now skipped and logged at WARNING instead of crashing the batch, so good rows in the same batch keep flowing. The non-sorted insert path uses a static key_ttl_seconds and cannot overflow from row data, so it needs no guard.

Which issue(s) this PR fixes:

Misc

A SortedFeatureView row with a far-future event_timestamp produces a per-row TTL above Cassandra's 20-year cap (630,720,000s). Because the TTL is inlined into the CQL statement, session.prepare() rejects it ("ttl is too large" / "Unable to make int from ..."). That exception is raised during batch construction, bypasses the async on_failure handler, and aborts the entire micro-batch — stalling a stream indefinitely on a single bad record (the checkpoint can never advance past the poison row).

Add a CASSANDRA_MAX_TTL guard mirroring the existing 'ttl < 0' skip: oversized-TTL rows are now skipped and logged at WARNING instead of crashing the batch, so good rows in the same batch keep flowing. The non-sorted insert path uses a static key_ttl_seconds and cannot overflow from row data, so it needs no guard.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Manisha4 Manisha4 changed the title fix: skip Cassandra rows whose TTL exceeds the 20-year maximum fix: Skip Cassandra rows whose TTL exceeds the 20-year maximum Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant