Skip to content

CNDB-14392: Use QueryView's MemtableIndex references for search (#1799) #1888

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

Merged
merged 1 commit into from
Jul 18, 2025

Conversation

driftx
Copy link

@driftx driftx commented Jul 17, 2025

  • Create a failing test
  • Parameterize DropIndexWhileQueryingTest, making it fail
  • CNDB-14392: Use QueryView's MemtableIndex references for search

What is the issue

Fixes: https://github.com/riptano/cndb/issues/14392

What does this PR fix and why was it fixed

We incorrectly use the liveMemtables at search time instead of the QueryView.memtables for the memory index search. This leads to incorrect behavior when a memtable is flushed or dropped after we acquire the QueryView and before we search the liveMemtables. The solution is easy: use the referenced QueryView to get the memtables

- **Create a failing test**
- **Parameterize DropIndexWhileQueryingTest, making it fail**
- **CNDB-14392: Use QueryView's MemtableIndex references for search**

### What is the issue
Fixes: riptano/cndb#14392

### What does this PR fix and why was it fixed
We incorrectly use the `liveMemtables` at search time instead of the
`QueryView.memtables` for the memory index search. This leads to
incorrect behavior when a memtable is flushed or dropped after we
acquire the `QueryView` and before we search the `liveMemtables`. The
solution is easy: use the referenced `QueryView` to get the memtables

---------

Co-authored-by: Piotr Kołaczkowski <[email protected]>
Copy link

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
  • All new files should contain the DataStax copyright header instead of the Apache License one

@driftx
Copy link
Author

driftx commented Jul 17, 2025

Adapted to the existing QueryView structure in 5.0, adjusted imports.

@driftx driftx requested a review from djatnieks July 17, 2025 20:08
Copy link

@cassci-bot
Copy link

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


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


Found 39 new test failures

Showing only first 15 new test failures

Test Explanation Branch history Upstream history
...lidation.operations.AlterTest-compression_jdk11 regression 🔴
...nQueryShouldNotTimeoutWhenItExceedesReadTimeout regression 🔴
...nglePageReadIsFastButAggregationExceedesTimeout regression 🔴
...adCommitLogAndSSTablesWithDroppedColumnTestCC40 regression 🔴
...adCommitLogAndSSTablesWithDroppedColumnTestCC50 regression 🔴
...oadCommitLogAndSSTablesWithDroppedColumnTestDSE regression 🔴
...thRestartTest.testReadingValuesOfDroppedColumns regression 🔴
o.a.c.d.t.s.f.FeaturesVersionSupportDBTest.testANN regression 🔴
o.a.c.d.t.s.f.FeaturesVersionSupportDCTest.testANN regression 🔴
o.a.c.d.t.s.f.FeaturesVersionSupportEBTest.testANN regression 🔴
...c.FeaturesVersionSupportTest.testANNSupport[eb] regression 🔴
....FeaturesVersionSupportTest.testGeoDistance[aa] regression 🔴
....FeaturesVersionSupportTest.testGeoDistance[ba] regression 🔴
....s.f.SnapshotTest.shouldTakeAndRestoreSnapshots regression 🔴
...cySSTableTest.testVerifyOldDroppedTupleSSTables regression 🔴

No known test failures found

@djatnieks
Copy link

This one also shows some regressions that should probably be looked at. Or, maybe a previous commit introduced them and butler won't show it until tonights build is complete?
http://butler-stargazer.aws.dsinternal.org/#/ci/upstream/compare/ds-cassandra-pr-gate/CNDB-14844/to/ds-cassandra-build-nightly-5.0/main-5.0

@driftx
Copy link
Author

driftx commented Jul 18, 2025

These look like the same failures that I fixed on CNDB-14841, let's get that merged and then I will rebase this and I think that should do it.

@driftx driftx merged commit fa8187b into main-5.0 Jul 18, 2025
565 of 590 checks passed
@driftx driftx deleted the CNDB-14844 branch July 18, 2025 16:36
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