Skip to content
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

CNDB-12739: Fix row filter ignoring distinct index and query analyzers #1548

Merged
merged 4 commits into from
Feb 6, 2025

Conversation

adelapena
Copy link

Make RowFilter.Expression consider the two different analyzers that an index can have, one for write time and the other for read time.

@adelapena adelapena self-assigned this Feb 5, 2025
Copy link

github-actions bot commented Feb 5, 2025

Checklist before you submit for review

  • Make sure there is a PR in the CNDB project updating the Converged Cassandra version
  • Use NoSpamLogger for log lines that may appear frequently in the logs
  • Verify test results on Butler
  • Test coverage for new/modified code is > 80%
  • Proper code formatting
  • Proper title for each commit staring with the project-issue number, like CNDB-1234
  • Each commit has a meaningful description
  • Each commit is not very long and contains related changes
  • Renames, moves and reformatting are in distinct commits

@ekaterinadimitrova2
Copy link

ekaterinadimitrova2 commented Feb 5, 2025

I understand we care the most about the test case added at the moment. But I want to point out a few things for follow-up:

While you check that I will verify also the other PR

AbstractAnalyzer analyzer = factory.create();
try
{
analyzer.reset(value);

Choose a reason for hiding this comment

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

Shouldn't this do the reset on a duplicate of value?

Copy link
Author

Choose a reason for hiding this comment

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

Probably yes. I guess it's not failing because the caller doesn't do anything with the value after calling this, but it looks risky anyway, so I've added the duplication.

Copy link

@ekaterinadimitrova2 ekaterinadimitrova2 Feb 5, 2025

Choose a reason for hiding this comment

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

What you said makes sense to me. As we need to be very careful with this PR - @michaeljmarshall , third pair of eyes on this, please, if you have a moment?

Copy link
Member

Choose a reason for hiding this comment

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

I agree that calling duplicate is the safe option here and unless we have a reason to believe it is a hotspot, we should just call duplicate for now.

@adelapena
Copy link
Author

adelapena commented Feb 5, 2025

  • test coverage pointed by sonar

Changing the signature of Operator#isSatisfiedBy makes a lot of already existing, mostly unrelated, poorly tested code visible to Sonar.

Copy link
Member

@michaeljmarshall michaeljmarshall left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -93,7 +93,7 @@ public Set<ColumnMetadata> getAnalyzedColumns(IndexRegistry indexRegistry)

for (ColumnCondition condition : this)
{
if (indexRegistry.getAnalyzerFor(condition.column, condition.operator).isPresent())
if (indexRegistry.getIndexAnalyzerFor(condition.column, condition.operator).isPresent())
Copy link
Member

Choose a reason for hiding this comment

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

This is unrelated to the PR, so should not block anything, but I wonder if we should add a method that checks if the column is analyzed instead of this getter, which allocates at least 2 objects per analyzer.

Copy link

@ekaterinadimitrova2 ekaterinadimitrova2 left a comment

Choose a reason for hiding this comment

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

+1 on clean CI (still running), thank you

@cassci-bot
Copy link

❌ Build ds-cassandra-pr-gate/PR-1548 rejected by Butler


1 new test failure(s) in 4 builds
See build details here


Found 1 new test failures

Test Explanation Branch history Upstream history
o.a.c.u.b.BinLogTest.testTruncationReleasesLogS... regression 🔴🔴🔴🔵 🔵🔵🔵🔵🔵🔵🔵

Found 7 known test failures

@adelapena adelapena merged commit 4544627 into main Feb 6, 2025
466 of 475 checks passed
@adelapena adelapena deleted the CNDB-12739-main branch February 6, 2025 13:37
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.

4 participants