Skip to content

CASSANDRA-21505: Fix Harry model CAS IF EQ/NEQ handling of meaningless empty bytes - #5010

Open
minal-kyada wants to merge 3 commits into
apache:trunkfrom
minal-kyada:paxos-lwt-cas-emptyvaluemeaningless-fix
Open

CASSANDRA-21505: Fix Harry model CAS IF EQ/NEQ handling of meaningless empty bytes#5010
minal-kyada wants to merge 3 commits into
apache:trunkfrom
minal-kyada:paxos-lwt-cas-emptyvaluemeaningless-fix

Conversation

@minal-kyada

@minal-kyada minal-kyada commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

The Harry model incorrectly normalized empty bytes to null for all code paths in extract0, causing CAS IF EQ/NEQ conditions to mis-predict, the server compares raw bytes so empty bytes stored for meaningless-empty types correctly satisfies an empty bytes condition, but the model predicted otherwise.

Fix adds a preserveEmpty flag to extract/extract0, scoped exclusively to CAS IF EQ/NEQ conditions. All other paths are intentionally left unchanged as they rely on the existing null normalization.

patch by @minal-kyada ; reviewed by @dcapwell @bdeggleston for CASSANDRA-21505

The Cassandra Jira

@minal-kyada
minal-kyada force-pushed the paxos-lwt-cas-emptyvaluemeaningless-fix branch from bd46d77 to d3317e2 Compare August 14, 2026 20:57
@minal-kyada minal-kyada changed the title Added isEmptyValueMeaningless support for LWT/CAS CASSANDRA-21505: CAS EQ/NEQ incorrectly distinguishes null from meaningless empty bytes for fixed-length types due to missing sanitization Aug 14, 2026
Comment thread test/harry/main/org/apache/cassandra/harry/model/ASTSingleTableModel.java Outdated
@minal-kyada
minal-kyada force-pushed the paxos-lwt-cas-emptyvaluemeaningless-fix branch from d3317e2 to d4440e2 Compare August 20, 2026 19:24
@minal-kyada
minal-kyada requested a review from dcapwell August 20, 2026 19:27
Comment thread test/harry/main/org/apache/cassandra/harry/model/ASTSingleTableModel.java Outdated

@dcapwell dcapwell 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.

+1 from me. We will need to run the tests many times to make sure nothing unexpected happens

@minal-kyada

Copy link
Copy Markdown
Contributor Author

+1 from me. We will need to run the tests many times to make sure nothing unexpected happens

Tried running the repeat job for PaxosV2MultiNodeTableWalkTest, and FullAccordInteropMultiNodeTableWalkTest for 1000 times. Spotted 2 failures which are being separately tracked here https://issues.apache.org/jira/browse/CASSANDRA-21505.

@bdeggleston bdeggleston left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1

@minal-kyada minal-kyada changed the title CASSANDRA-21505: CAS EQ/NEQ incorrectly distinguishes null from meaningless empty bytes for fixed-length types due to missing sanitization CASSANDRA-21505: Fix Harry model CAS IF EQ/NEQ handling of meaningless empty bytes Aug 20, 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.

3 participants