michaeljmarshall commented on code in PR #4353:
URL: https://github.com/apache/cassandra/pull/4353#discussion_r2683911485


##########
src/java/org/apache/cassandra/index/sai/StorageAttachedIndexGroup.java:
##########
@@ -173,6 +173,15 @@ public Index.Indexer indexerFor(Predicate<Index> 
indexSelector,
 
         return indexers.isEmpty() ? null : new Index.Indexer()
         {
+            @Override
+            public void begin()
+            {
+                // TODO is this a good solution? I only need this because we 
do not always
+                //  indexed everything in insertRow and updateRow.
+                for (Index.Indexer indexer : indexers)
+                    indexer.begin();

Review Comment:
   In an alternate version, I implemented these other methods:
   
   ```java
           @Override
           public void partitionDelete(DeletionTime deletionTime)
           {
               // Initialize the memtable index to ensure proper SAI views of 
the data
               indexContext.initializeMemtableIndex(mt);
           }
   
           @Override
           public void rangeTombstone(RangeTombstone tombstone)
           {
               // Initialize the memtable index to ensure proper SAI views of 
the data
               indexContext.initializeMemtableIndex(mt);
           }
   
           @Override
           public void removeRow(Row row)
           {
               // Initialize the memtable index to ensure proper SAI views of 
the data
               indexContext.initializeMemtableIndex(mt);
           }
   ```
   
   the issue here is making sure that the `View` object has a reference to all 
relevant memtables. I don't remember why I didn't use this logic when I first 
wrote this patch in August, but I think that might be better since it covers 
the actual missing cases without adding overhead to the insert/update paths.



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