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-12484: Fix flaky VectorUpdateDeleteTest failures #1519

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/java/org/apache/cassandra/db/ColumnFamilyStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -1894,6 +1894,12 @@ public Tracker getTracker()
return data;
}


/**
* Convenience method for getting the set of live sstables associated with this ColumnFamilyStore. Note that this
* will also contain any early-opened sstables.
* @return the tracker's current view's {@link SSTableSet#LIVE} sstables
*/
public Set<SSTableReader> getLiveSSTables()
{
return data.getLiveSSTables();
Expand Down
20 changes: 13 additions & 7 deletions test/unit/org/apache/cassandra/index/sai/SAITester.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
import org.apache.cassandra.db.Directories;
import org.apache.cassandra.db.Keyspace;
import org.apache.cassandra.db.compaction.CompactionManager;
import org.apache.cassandra.db.lifecycle.SSTableSet;
jkni marked this conversation as resolved.
Show resolved Hide resolved
import org.apache.cassandra.db.lifecycle.View;
import org.apache.cassandra.db.marshal.AbstractType;
import org.apache.cassandra.db.marshal.UTF8Type;
import org.apache.cassandra.exceptions.RequestFailureReason;
Expand Down Expand Up @@ -332,15 +334,19 @@ protected boolean verifyChecksum(IndexContext context)
{
ColumnFamilyStore cfs = Keyspace.open(KEYSPACE).getColumnFamilyStore(currentTable());

for (SSTableReader sstable : cfs.getLiveSSTables())
try (ColumnFamilyStore.RefViewFragment rvf = cfs.selectAndReference(View.selectFunction(SSTableSet.CANONICAL)))
{
IndexDescriptor indexDescriptor = loadDescriptor(sstable, cfs);
if (indexDescriptor.isIndexEmpty(context))
continue;
if (!indexDescriptor.perSSTableComponents().validateComponents(sstable, cfs.getTracker(), true)
|| !indexDescriptor.perIndexComponents(context).validateComponents(sstable, cfs.getTracker(), true))
return false;
for (SSTableReader sstable : rvf.sstables)
{
IndexDescriptor indexDescriptor = loadDescriptor(sstable, cfs);
if (indexDescriptor.isIndexEmpty(context))
continue;
if (!indexDescriptor.perSSTableComponents().validateComponents(sstable, cfs.getTracker(), true)
|| !indexDescriptor.perIndexComponents(context).validateComponents(sstable, cfs.getTracker(), true))
return false;
}
}

return true;
}

Expand Down