allow dropping columns shadowed by not-yet-expired supercolumn or row tombstones in PrecompactedRow

patch by jbellis; reviewed by slebresne for CASSANDRA-4396
This commit is contained in:
Jonathan Ellis 2012-07-02 02:56:03 -05:00
parent 5aad64a699
commit 5bcfcbc3ed
6 changed files with 8 additions and 6 deletions

View File

@ -1,4 +1,6 @@
1.0.11
* allow dropping columns shadowed by not-yet-expired supercolumn or row
tombstones in PrecompactedRow (CASSANDRA-4396)
* synchronize LCS getEstimatedTasks to avoid CME (CASSANDRA-4255)
* ensure unique streaming session id's (CASSANDRA-4223)
* kick off background compaction when min/max thresholds change

View File

@ -251,13 +251,13 @@ public abstract class AbstractColumnContainer implements IColumnContainer, IIter
}
}
public boolean hasExpiredTombstones(int gcBefore)
public boolean hasIrrelevantData(int gcBefore)
{
if (isMarkedForDelete() && getLocalDeletionTime() < gcBefore)
return true;
for (IColumn column : columns)
if (column.hasExpiredTombstones(gcBefore))
if (column.mostRecentLiveChangeAt() < getLocalDeletionTime() || column.hasIrrelevantData(gcBefore))
return true;
return false;

View File

@ -281,7 +281,7 @@ public class Column implements IColumn
valueValidator.validate(value());
}
public boolean hasExpiredTombstones(int gcBefore)
public boolean hasIrrelevantData(int gcBefore)
{
return isMarkedForDelete() && getLocalDeletionTime() < gcBefore;
}

View File

@ -75,7 +75,7 @@ public interface IColumn
/**
* @return true if the column or any its subcolumns expired before @param gcBefore
*/
public boolean hasExpiredTombstones(int gcBefore);
public boolean hasIrrelevantData(int gcBefore);
/**
* For a standard column, this is the same as timestamp().

View File

@ -44,7 +44,7 @@ public interface IColumnContainer
public boolean isMarkedForDelete();
public long getMarkedForDeleteAt();
public boolean hasExpiredTombstones(int gcBefore);
public boolean hasIrrelevantData(int gcBefore);
public AbstractType getComparator();

View File

@ -67,7 +67,7 @@ public class PrecompactedRow extends AbstractCompactedRow
// taking this into account.
Boolean shouldPurge = null;
if (cf.hasExpiredTombstones(controller.gcBefore))
if (cf.hasIrrelevantData(controller.gcBefore))
shouldPurge = controller.shouldPurge(key);
ColumnFamily compacted = shouldPurge != null && shouldPurge
? ColumnFamilyStore.removeDeleted(cf, controller.gcBefore)