maedhroz commented on code in PR #3083:
URL: https://github.com/apache/cassandra/pull/3083#discussion_r1491827213
##########
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?
Review Comment:
@adelapena This might be my biggest outstanding question, as it has both
performance and correctness implications. At the row level above, we trigger
fetch on any `null` row, but that's because if all versions were `null`, we
would never inspect the versions in the first place. Here, it seems like we can
actually avoid an RFP fetch if the cells for a column are null across ALL
versions...
--
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]