cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [cassandra] blerer commented on a change in pull request #559: CASSANDRA-13666 Avoid rendering static 2i entries as stales and removing them
Date Mon, 18 May 2020 09:26:53 GMT

blerer commented on a change in pull request #559:

File path: src/java/org/apache/cassandra/index/internal/composites/
@@ -231,16 +231,27 @@ private IndexEntry findEntry(Clustering clustering)
                 while (entriesIdx < entries.size())
                     IndexEntry entry = entries.get(entriesIdx++);
+                    Clustering indexedEntryClustering = entry.indexedEntryClustering;
                     // The entries are in clustering order. So that the requested entry should
be the
                     // next entry, the one at 'entriesIdx'. However, we can have stale entries,
                     // that have no corresponding row in the base table typically because
of a range
                     // tombstone or partition level deletion. Delete such stale entries.
-                    int cmp =, clustering);
+                    int cmp =, clustering);
                     assert cmp <= 0; // this would means entries are not in clustering
order, which shouldn't happen
                     if (cmp == 0)
                         return entry;
-                        staleEntries.add(entry);
+                    {
+                        boolean isStaticClustering = dataIter.metadata().hasStaticColumns();

Review comment:
       It is effectively a bit hard to read. I would have done something like:
   boolean hasStaticColumns = dataIter.metadata().hasStaticColumns();
   			// COMPACT COMPOSITE tables support null values in there clustering key but
                           // those tables do not support static columns. By consequence if
a table
                           // has some static columns and all its clustering key elements
are null
                           // it means that the partition exists and contains only static
                           if (!hasStaticColumns() || !containsOnlyNullValues(indexedEntryClustering)

   What do you think?

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.

For queries about this service, please contact Infrastructure at:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message