[ 
https://issues.apache.org/jira/browse/CASSANDRA-5077?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yuki Morishita reopened CASSANDRA-5077:
---------------------------------------


This broke CompactionsPurgeTest because if the last iterated row in compaction 
task is empty, SSTableWriter does not get closed.
The code below fixes this(but I feel a bit redundant):

{code}
                 AbstractCompactedRow row = iter.next();
                 if (row.isEmpty())
                 {
                     controller.invalidateCachedRow(row.key);
                     row.close();
+                    // make sure we close SSTableWriter at the end of iteration
+                    if (!iter.hasNext())
+                    {
+                        SSTableReader toIndex = 
writer.closeAndOpenReader(getMaxDataAge(toCompact));
+                        cachedKeyMap.put(toIndex, cachedKeys);
+                        sstables.add(toIndex);
+                    }
                     continue;
                 }
{code}
                
> Simplify CompactionIterable.getReduced
> --------------------------------------
>
>                 Key: CASSANDRA-5077
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5077
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Jonathan Ellis
>            Assignee: Jonathan Ellis
>             Fix For: 1.2.1
>
>         Attachments: 5077.txt, 5077.txt
>
>
> CompactionIterable turns empty rows into null, and 
> purge-compacted-rows-from-cache logic is duplicated (and different!) across 
> implementations.  Let's simplify to just return empty rows as-is and let 
> CompactionTask handle the purge logic.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to