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


##########
src/java/org/apache/cassandra/index/sai/StorageAttachedIndexGroup.java:
##########
@@ -250,15 +250,15 @@ public void handleNotification(INotification 
notification, Object sender)
             SSTableAddedNotification notice = (SSTableAddedNotification) 
notification;
 
             // Avoid validation for index files just written following 
Memtable flush.
-            boolean validate = !notice.memtable().isPresent();
+            IndexValidation validate = notice.memtable().isPresent() ? 
IndexValidation.NONE : IndexValidation.CHECKSUM;

Review Comment:
   @mike-tr-adamson @pkolaczk I'm okay w/ doing this in another Jira. There's 
enough risk to make sure we focus on it specifically, and after this patch 
we'll only be doing something sub-optimally, not incorrectly. Now...in solution 
space...
   
   > The index build should only build the per-column indexes if 
fullRebuild=true, the index doesn't exist, or the index is invalid. In either 
case, the SSTables must be registered (on build completion or immediately).
   
   I don't see any problem w/ this, although I'm not sure I understand the 
problem in the streaming context.
   
   > The invoked index build will rebuild the per-column index components for 
fullRebuild = false even if the components are present and valid. We do, 
though, only build the per-SSTable components if they are invalid, in this case.
   
   Right after streaming, no index components for the new SSTables are present, 
right?
   
   > The SAIG should only register the SSTables if the memtable is present and 
shouldn't validate the components because this is the result of a memtable 
flush.
   
   `StorageAttachedIndexGroup` registering and validating newly streamed entire 
index components is what makes this patch work, right? If we stopped doing 
that, who would register/checksum when the `SIM`-triggered build is a no-op?



-- 
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