You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ty...@apache.org on 2015/01/14 18:35:04 UTC

[1/3] cassandra git commit: Fix slice size calculation for 2ary index table slices

Repository: cassandra
Updated Branches:
  refs/heads/trunk 4937451f5 -> 88b51539f


Fix slice size calculation for 2ary index table slices

Patch by Tyler Hobbs; reviewed by Benjamin Lerer for CASSANDRA-8550


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/90780b55
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/90780b55
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/90780b55

Branch: refs/heads/trunk
Commit: 90780b550f39bc318567ac53f8e8e7d797697f16
Parents: e16d76d
Author: Tyler Hobbs <ty...@datastax.com>
Authored: Wed Jan 14 11:31:26 2015 -0600
Committer: Tyler Hobbs <ty...@datastax.com>
Committed: Wed Jan 14 11:32:45 2015 -0600

----------------------------------------------------------------------
 CHANGES.txt                                              |  2 ++
 .../db/index/composites/CompositesSearcher.java          | 11 +++++------
 2 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/90780b55/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 92bf422..45b2b9c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.0.12:
+ * Use more efficient slice size for querying internal secondary
+   index tables (CASSANDRA-8550)
  * Fix potentially returning deleted rows with range tombstone (CASSANDRA-8558)
  * Make sure we unmark compacting after scrub/cleanup etc (CASSANDRA-8548)
  * Check for available disk space before starting a compaction (CASSANDRA-8562)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/90780b55/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java b/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
index b978021..9370133 100644
--- a/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
+++ b/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
@@ -107,9 +107,8 @@ public class CompositesSearcher extends SecondaryIndexSearcher
             private int limit = filter.currentLimit();
             private int columnsCount = 0;
 
-            private int meanColumns = Math.max(index.getIndexCfs().getMeanColumns(), 1);
-            // We shouldn't fetch only 1 row as this provides buggy paging in case the first row doesn't satisfy all clauses
-            private int rowsPerQuery = Math.max(Math.min(filter.maxRows(), filter.maxColumns() / meanColumns), 2);
+            // We have to fetch at least two rows to avoid breaking paging if the first row doesn't satisfy all clauses
+            private int indexCellsPerQuery = Math.max(2, Math.min(filter.maxColumns(), filter.maxRows()));
 
             public boolean needsFiltering()
             {
@@ -144,9 +143,9 @@ public class CompositesSearcher extends SecondaryIndexSearcher
 
                     if (indexColumns == null || indexColumns.isEmpty())
                     {
-                        if (columnsRead < rowsPerQuery)
+                        if (columnsRead < indexCellsPerQuery)
                         {
-                            logger.trace("Read only {} (< {}) last page through, must be done", columnsRead, rowsPerQuery);
+                            logger.trace("Read only {} (< {}) last page through, must be done", columnsRead, indexCellsPerQuery);
                             return makeReturn(currentKey, data);
                         }
 
@@ -159,7 +158,7 @@ public class CompositesSearcher extends SecondaryIndexSearcher
                                                                              lastSeenPrefix,
                                                                              endPrefix,
                                                                              false,
-                                                                             rowsPerQuery,
+                                                                             indexCellsPerQuery,
                                                                              filter.timestamp);
                         ColumnFamily indexRow = index.getIndexCfs().getColumnFamily(indexFilter);
                         if (indexRow == null || indexRow.getColumnCount() == 0)


[3/3] cassandra git commit: Merge branch 'cassandra-2.1' into trunk

Posted by ty...@apache.org.
Merge branch 'cassandra-2.1' into trunk


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/88b51539
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/88b51539
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/88b51539

Branch: refs/heads/trunk
Commit: 88b51539fb148124b76679eb9bd4b24543a9d5bb
Parents: 4937451 7804a53
Author: Tyler Hobbs <ty...@datastax.com>
Authored: Wed Jan 14 11:34:53 2015 -0600
Committer: Tyler Hobbs <ty...@datastax.com>
Committed: Wed Jan 14 11:34:53 2015 -0600

----------------------------------------------------------------------
 CHANGES.txt                                              |  2 ++
 .../db/index/composites/CompositesSearcher.java          | 11 +++++------
 2 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/88b51539/CHANGES.txt
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/88b51539/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
----------------------------------------------------------------------


[2/3] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

Posted by ty...@apache.org.
Merge branch 'cassandra-2.0' into cassandra-2.1

Conflicts:
	CHANGES.txt


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/7804a53c
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/7804a53c
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/7804a53c

Branch: refs/heads/trunk
Commit: 7804a53c90b24820570cbc5c82043517489abbe5
Parents: 686b810 90780b5
Author: Tyler Hobbs <ty...@datastax.com>
Authored: Wed Jan 14 11:34:28 2015 -0600
Committer: Tyler Hobbs <ty...@datastax.com>
Committed: Wed Jan 14 11:34:28 2015 -0600

----------------------------------------------------------------------
 CHANGES.txt                                              |  2 ++
 .../db/index/composites/CompositesSearcher.java          | 11 +++++------
 2 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7804a53c/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 8f312a7,45b2b9c..d2802ad
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,59 -1,8 +1,61 @@@
 -2.0.12:
 +2.1.3
 + * Fix NPE when passing wrong argument in ALTER TABLE statement (CASSANDRA-8355)
 + * Pig: Refactor and deprecate CqlStorage (CASSANDRA-8599)
 + * Don't reuse the same cleanup strategy for all sstables (CASSANDRA-8537)
 + * Fix case-sensitivity of index name on CREATE and DROP INDEX
 +   statements (CASSANDRA-8365)
 + * Better detection/logging for corruption in compressed sstables (CASSANDRA-8192)
 + * Use the correct repairedAt value when closing writer (CASSANDRA-8570)
 + * (cqlsh) Handle a schema mismatch being detected on startup (CASSANDRA-8512)
 + * Properly calculate expected write size during compaction (CASSANDRA-8532)
 + * Invalidate affected prepared statements when a table's columns
 +   are altered (CASSANDRA-7910)
 + * Stress - user defined writes should populate sequentally (CASSANDRA-8524)
 + * Fix regression in SSTableRewriter causing some rows to become unreadable 
 +   during compaction (CASSANDRA-8429)
 + * Run major compactions for repaired/unrepaired in parallel (CASSANDRA-8510)
 + * (cqlsh) Fix compression options in DESCRIBE TABLE output when compression
 +   is disabled (CASSANDRA-8288)
 + * (cqlsh) Fix DESCRIBE output after keyspaces are altered (CASSANDRA-7623)
 + * Make sure we set lastCompactedKey correctly (CASSANDRA-8463)
 + * (cqlsh) Fix output of CONSISTENCY command (CASSANDRA-8507)
 + * (cqlsh) Fixed the handling of LIST statements (CASSANDRA-8370)
 + * Make sstablescrub check leveled manifest again (CASSANDRA-8432)
 + * Check first/last keys in sstable when giving out positions (CASSANDRA-8458)
 + * Disable mmap on Windows (CASSANDRA-6993)
 + * Add missing ConsistencyLevels to cassandra-stress (CASSANDRA-8253)
 + * Add auth support to cassandra-stress (CASSANDRA-7985)
 + * Fix ArrayIndexOutOfBoundsException when generating error message
 +   for some CQL syntax errors (CASSANDRA-8455)
 + * Scale memtable slab allocation logarithmically (CASSANDRA-7882)
 + * cassandra-stress simultaneous inserts over same seed (CASSANDRA-7964)
 + * Reduce cassandra-stress sampling memory requirements (CASSANDRA-7926)
 + * Ensure memtable flush cannot expire commit log entries from its future (CASSANDRA-8383)
 + * Make read "defrag" async to reclaim memtables (CASSANDRA-8459)
 + * Remove tmplink files for offline compactions (CASSANDRA-8321)
 + * Reduce maxHintsInProgress (CASSANDRA-8415)
 + * BTree updates may call provided update function twice (CASSANDRA-8018)
 + * Release sstable references after anticompaction (CASSANDRA-8386)
 + * Handle abort() in SSTableRewriter properly (CASSANDRA-8320)
 + * Fix high size calculations for prepared statements (CASSANDRA-8231)
 + * Centralize shared executors (CASSANDRA-8055)
 + * Fix filtering for CONTAINS (KEY) relations on frozen collection
 +   clustering columns when the query is restricted to a single
 +   partition (CASSANDRA-8203)
 + * Do more aggressive entire-sstable TTL expiry checks (CASSANDRA-8243)
 + * Add more log info if readMeter is null (CASSANDRA-8238)
 + * add check of the system wall clock time at startup (CASSANDRA-8305)
 + * Support for frozen collections (CASSANDRA-7859)
 + * Fix overflow on histogram computation (CASSANDRA-8028)
 + * Have paxos reuse the timestamp generation of normal queries (CASSANDRA-7801)
 + * Fix incremental repair not remove parent session on remote (CASSANDRA-8291)
 + * Improve JBOD disk utilization (CASSANDRA-7386)
 + * Log failed host when preparing incremental repair (CASSANDRA-8228)
 + * Force config client mode in CQLSSTableWriter (CASSANDRA-8281)
 +Merged from 2.0:
+  * Use more efficient slice size for querying internal secondary
+    index tables (CASSANDRA-8550)
   * Fix potentially returning deleted rows with range tombstone (CASSANDRA-8558)
 - * Make sure we unmark compacting after scrub/cleanup etc (CASSANDRA-8548)
   * Check for available disk space before starting a compaction (CASSANDRA-8562)
   * Fix DISTINCT queries with LIMITs or paging when some partitions
     contain only tombstones (CASSANDRA-8490)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7804a53c/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
index 8483c15,9370133..8cc8aa8
--- a/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
+++ b/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
@@@ -161,11 -141,11 +160,11 @@@ public class CompositesSearcher extend
                      if (columnsCount >= limit)
                          return makeReturn(currentKey, data);
  
 -                    if (indexColumns == null || indexColumns.isEmpty())
 +                    if (indexCells == null || indexCells.isEmpty())
                      {
-                         if (columnsRead < rowsPerQuery)
+                         if (columnsRead < indexCellsPerQuery)
                          {
-                             logger.trace("Read only {} (< {}) last page through, must be done", columnsRead, rowsPerQuery);
+                             logger.trace("Read only {} (< {}) last page through, must be done", columnsRead, indexCellsPerQuery);
                              return makeReturn(currentKey, data);
                          }
  
@@@ -178,23 -158,23 +177,23 @@@
                                                                               lastSeenPrefix,
                                                                               endPrefix,
                                                                               false,
-                                                                              rowsPerQuery,
+                                                                              indexCellsPerQuery,
                                                                               filter.timestamp);
                          ColumnFamily indexRow = index.getIndexCfs().getColumnFamily(indexFilter);
 -                        if (indexRow == null || indexRow.getColumnCount() == 0)
 +                        if (indexRow == null || !indexRow.hasColumns())
                              return makeReturn(currentKey, data);
  
 -                        Collection<Column> sortedColumns = indexRow.getSortedColumns();
 -                        columnsRead = sortedColumns.size();
 -                        indexColumns = new ArrayDeque<>(sortedColumns);
 -                        Column firstColumn = sortedColumns.iterator().next();
 +                        Collection<Cell> sortedCells = indexRow.getSortedColumns();
 +                        columnsRead = sortedCells.size();
 +                        indexCells = new ArrayDeque<>(sortedCells);
 +                        Cell firstCell = sortedCells.iterator().next();
  
                          // Paging is racy, so it is possible the first column of a page is not the last seen one.
 -                        if (lastSeenPrefix != startPrefix && lastSeenPrefix.equals(firstColumn.name()))
 +                        if (lastSeenPrefix != startPrefix && lastSeenPrefix.equals(firstCell.name()))
                          {
                              // skip the row we already saw w/ the last page of results
 -                            indexColumns.poll();
 -                            logger.trace("Skipping {}", indexComparator.getString(firstColumn.name()));
 +                            indexCells.poll();
 +                            logger.trace("Skipping {}", indexComparator.getString(firstCell.name()));
                          }
                      }