Skip to content

CASSANDRA-20297: Fix null field accounting #167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

ifesdjeen
Copy link
Contributor

No description provided.

@ifesdjeen ifesdjeen changed the title Fix null field accounting CASSANDRA-20297: Fix null field accounting Feb 6, 2025
@ifesdjeen ifesdjeen marked this pull request as ready for review February 6, 2025 13:26
else
return setChanged(field, flags);
}
VAL l = convert.apply(lo);

if (l == r) return flags; // no change
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be handled here in these return flags, but could you perhaps explain more (also in a comment) why this is necessary? I think it might introduce bugs with compaction, as we seem to be setting to null any field that is null in both input and output, but for compaction of partial results we can expect fields to just not participate in the compaction (i.e. be null in both sides) but be not null in any constructed object, and this could cause them to be shadowed and nulled out, no?

Is this to handle the TruncatedApply case, and erasing Result? If so, I think it is better to special-case truncation, and to produce a null field mask directly.

Copy link
Contributor

@belliottsmith belliottsmith left a comment

Choose a reason for hiding this comment

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

This works for me, although I might slightly prefer that we precomputed some flags and saved them in SaveStatus and just did |= saveStatus.commandChangeFlags. This would permit us to clear other registers too (e.g. DepsErased, ExecuteAtErased etc), and do it in a simple declarative way.

@ifesdjeen
Copy link
Contributor Author

@belliottsmith great idea! Pushed the implementation and test for this.

Copy link
Contributor

@belliottsmith belliottsmith left a comment

Choose a reason for hiding this comment

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

Only one suggestion: there's an edge case with Vestigial for which - for distributed inference - we don't declare that any of the values are Erased, even though we have erased them. Perhaps we could reify this in the SaveStatus somehow, but for now at least it would be most robust to special-case this SaveStatus and set all of the null/changed flags for Vestigial.

@ifesdjeen ifesdjeen force-pushed the CASSANDRA-20297 branch 2 times, most recently from 758a2bc to 1f1e5b1 Compare February 11, 2025 09:11
Patch by Alex Petrov; reviewed by Benedict Elliott Smith for CASSANDRA-20297
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.

None yet

2 participants