maedhroz commented on code in PR #4428:
URL: https://github.com/apache/cassandra/pull/4428#discussion_r2535395622


##########
src/java/org/apache/cassandra/db/SSTableImporter.java:
##########
@@ -233,7 +238,13 @@ synchronized List<String> importNewSSTables(Options 
options)
             if (!cfs.indexManager.validateSSTableAttachedIndexes(newSSTables, 
false, options.validateIndexChecksum))
                 
cfs.indexManager.buildSSTableAttachedIndexesBlocking(newSSTables);

Review Comment:
   There are a few different scenarios here when an SAI index is present:
   
   1.) SSTables are imported, but SAI components are not imported alongside 
them. In this case, `buildSSTableAttachedIndexesBlocking()` is called to make 
sure that they DO exist by the time `addSSTables()` is called.
   
   2.) SSTables are imported w/ SAI components as well. In this case, we don't 
build anything, as validation should pass, and everything is where it should be.
   
   In the tracked case, we need to stream, so I think one of two things can 
happen. (I think we need explicit tests for both of these.) The first is that 
we're not streaming entire files, in which case SAI indexes are going to have 
to be built on the receiving end. I think this should actually work right now, 
because the observer framework/listener stuff builds the index as it's written. 
However, I'm worried about the full file streaming case, because for that to 
work, the SAI components need to be added to the manifest before the stream 
starts. Looking at what's downstream of `SSTableReader.open()` in the importer 
for the tracked case, it looks like it does detect existing SAI components 
though...
   
   Anyway, I speculate. We just need a test for this. We don't have 
[CASSANDRA-20374](https://issues.apache.org/jira/browse/CASSANDRA-20374) yet in 
this branch, of course, since it's not merged yet, but testing just the 
streaming and index building part (can just check index queryability) wouldn't 
be that bad.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to