Skip to content

CNDB-16787: Make updates to VectorMemtableIndex min/max primary key atomic#2236

Open
michaeljmarshall wants to merge 1 commit intomainfrom
cndb-16787
Open

CNDB-16787: Make updates to VectorMemtableIndex min/max primary key atomic#2236
michaeljmarshall wants to merge 1 commit intomainfrom
cndb-16787

Conversation

@michaeljmarshall
Copy link
Member

@michaeljmarshall michaeljmarshall commented Feb 17, 2026

What is the issue

Fixes: https://github.com/riptano/cndb/issues/16787
CNDB test pr: https://github.com/riptano/cndb/pull/16790

What does this PR fix and why was it fixed

The VectorMemtableIndex should use AtomicReference wrappers to ensure we atomically update the min and max primary keys. I used CAS loops to achieve a lockless solution.

It appears possible to optimize this further by using primaryKeys.first(), a constant time operation, to replace the minimumKey tracking. However, it's not clear that this is a hot spot, so I'll defer on changing the semantics for now. Another option could be to use getPlain() since the max is monotonically increasing and the vast majority of updates will not bump the max key.

@github-actions
Copy link

Checklist before you submit for review

  • This PR adheres to the Definition of Done
  • 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

@sonarqubecloud
Copy link

@cassci-bot
Copy link

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


2 regressions found
See build details here


Found 2 new test failures

Test Explanation Runs Upstream
o.a.c.index.sai.cql.VectorCompaction100dTest.testZeroOrOneToManyCompaction[eb false] REGRESSION 🔴 0 / 10
o.a.c.index.sai.cql.VectorSiftSmallTest.testMultiSegmentBuild[dc false] REGRESSION 🔴 0 / 10

No known test failures found

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.

2 participants