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


##########
src/java/org/apache/cassandra/service/reads/ReplicaFilteringProtection.java:
##########
@@ -208,34 +211,33 @@ public void onMergedPartitionLevelDeletion(DeletionTime 
mergedDeletion, Deletion
                     }
 
                     @Override
-                    public Row onMergedRows(Row merged, Row[] versions)
+                    public void onMergedRows(Row merged, Row[] versions)
                     {
                         // cache the row versions to be able to regenerate the 
original row iterator
                         for (int i = 0; i < versions.length; i++)
                             builders.get(i).addRow(versions[i]);
 
                         if (merged.isEmpty())
-                            return merged;
+                            return;
+
+                        Arrays.fill(fetchFrom, false);
 
-                        boolean isPotentiallyOutdated = false;
-                        boolean isStatic = merged.isStatic();
+                        // Check for outdated rows at the row level...
                         for (int i = 0; i < versions.length; i++)
-                        {
-                            Row version = versions[i];
-                            if (version == null || (isStatic && 
version.isEmpty()))
-                            {
-                                isPotentiallyOutdated = true;
+                            if (versions[i] == null || (merged.isStatic() && 
versions[i].isEmpty()))
+                                fetchFrom[i] = true;
+
+                        // ...and then if nothing is amiss at the row level, 
check the individual columns:
+                        // TODO: If all the values are null for a column, do 
we actually care about fetching those again?
+                        for (ColumnMetadata column : columns)
+                            for (int i = 0; i < versions.length; i++)
+                                //noinspection DataFlowIssue

Review Comment:
   If `versions[I]` was `null`, we would have marked `fetchFrom[I]`, so I don't 
think a NPE is possible.



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