CASSANDRA-21152: Fix expired row handling in CursorCompactor and disable for Materialized Views#4610
Open
arvindKandpal-ksolves wants to merge 2 commits intoapache:trunkfrom
Open
Conversation
…ble for Materialized Views
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses a regression introduced by Cursor Compaction (CASSANDRA-20918) which caused
dtest.TestMaterializedViews.test_mv_with_default_ttl_with_flushto fail.Issues Identified:
CursorCompactor.mergeRowsmethod was manually merging rows but failed to check if theLivenessInfowas expired (TTL). This caused expired rows to persist as "live" (zombie rows) in the output.CursorCompactorcurrently lacks theGarbageSkipperlogic found inCompactionIterator. Materialized Views rely on this to handle shadowable tombstones correctly.The Fix:
CursorCompactor.mergeRowsto explicitly check(mergedRowInfo.isExpiring() && !mergedRowInfo.isLive(nowInSec))effectively dropping expired rows.CursorCompactor.isSupportedto returnfalsefor Materialized Views. This forces them to use the standardCompactionIterator(fallback), ensuring correct shadowing behavior untilCursorCompactorsupports it.patch by Arvind Kandpal; for CASSANDRA-21152