Skip to content

CASSANDRA-21152: Fix expired row handling in CursorCompactor and disable for Materialized Views#4610

Open
arvindKandpal-ksolves wants to merge 2 commits intoapache:trunkfrom
arvindKandpal-ksolves:CASSANDRA-21152
Open

CASSANDRA-21152: Fix expired row handling in CursorCompactor and disable for Materialized Views#4610
arvindKandpal-ksolves wants to merge 2 commits intoapache:trunkfrom
arvindKandpal-ksolves:CASSANDRA-21152

Conversation

@arvindKandpal-ksolves
Copy link
Contributor

This PR addresses a regression introduced by Cursor Compaction (CASSANDRA-20918) which caused dtest.TestMaterializedViews.test_mv_with_default_ttl_with_flush to fail.

Issues Identified:

  1. Missing Expiration Check: The CursorCompactor.mergeRows method was manually merging rows but failed to check if the LivenessInfo was expired (TTL). This caused expired rows to persist as "live" (zombie rows) in the output.
  2. Missing Garbage/Shadowing Logic: CursorCompactor currently lacks the GarbageSkipper logic found in CompactionIterator. Materialized Views rely on this to handle shadowable tombstones correctly.

The Fix:

  1. Updated CursorCompactor.mergeRows to explicitly check (mergedRowInfo.isExpiring() && !mergedRowInfo.isLive(nowInSec)) effectively dropping expired rows.
  2. Updated CursorCompactor.isSupported to return false for Materialized Views. This forces them to use the standard CompactionIterator (fallback), ensuring correct shadowing behavior until CursorCompactor supports it.

patch by Arvind Kandpal; for CASSANDRA-21152

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