Skip to content

CASSANALYTICS-196: Skip CDC-irrelevant mutations on deserialization failure - #241

Merged
bbotella merged 2 commits into
apache:trunkfrom
yifan-c:CASSANALYTICS-TBD/skip-cdc-irrelevant-mutation-on-deser-failure
Oct 7, 2026
Merged

bbotella merged 2 commits into
apache:trunkfrom
yifan-c:CASSANALYTICS-TBD/skip-cdc-irrelevant-mutation-on-deser-failure

Conversation

@yifan-c

@yifan-c yifan-c commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Patch by Yifan Cai; Reviewed by Bernardo Botella, Jyothsna Konisa for CASSANALYTICS-196

return false;
}

if (updateCount > 1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we check this before we need to extract the tableId and the metadata? (just at line 638)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It sounds good.

{
JVMStabilityInspector.inspectThrowable(t);

if (failedMutationHasNoCdcTable(inputBuffer, size))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is scary that this new behavior doesn't break a pre-existing test :-(

Comment on lines +69 to +70
CassandraBridgeImplementation.setup();
TableId unknownTableId = TableId.fromUUID(UUID.randomUUID());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Maybe move these two to a helper getUnregisteredTable method?

* when the table's metadata can't be found, or even the first {@link TableId} can't be read
*/
@VisibleForTesting
static boolean failedMutationHasNoCdcTable(byte[] inputBuffer, int size)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it is just me, but I tend to not like the negative on method names. HasNo + false is what we are looking for here -> that double negative always messes my head :-P

What do you think on having a failedMutationHasCdcTable method instead that returns true if it needs to be handled, and false if it needs to be ignored?

Obviously not a blocker.

@jyothsnakonisa jyothsnakonisa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

…ailure

Patch by Yifan Cai; Reviewed by TBD for CASSANALYTICS-196
@yifan-c
yifan-c force-pushed the CASSANALYTICS-TBD/skip-cdc-irrelevant-mutation-on-deser-failure branch from 68afffc to 318c80d Compare October 7, 2026 06:57
@bbotella

bbotella commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

+1

@bbotella
bbotella merged commit 769f4bc into apache:trunk Oct 7, 2026
51 of 52 checks passed
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.

3 participants