Fix partition-level-delete-only workload accounting

patch by benedict; reviewed by jbellis for CASSANDRA-9194
This commit is contained in:
Benedict Elliott Smith 2015-05-01 11:32:31 +01:00
parent 593a7257b5
commit f0c7a6f03c
2 changed files with 6 additions and 1 deletions

View File

@ -1,4 +1,5 @@
2.0.15:
* Fix partition-level-delete-only workload accounting (CASSANDRA-9194)
* Allow scrub to handle corrupted compressed chunks (CASSANDRA-9140)
* Fix assertion error when resetlocalschema is run during repair (CASSANDRA-9249)
* Disable single sstable tombstone compactions for DTCS by default (CASSANDRA-9234)

View File

@ -206,17 +206,21 @@ public class Memtable
{
AtomicSortedColumns previous = rows.get(key);
long initialSize = 0;
if (previous == null)
{
AtomicSortedColumns empty = cf.cloneMeShallow(AtomicSortedColumns.factory, false);
// We'll add the columns later. This avoids wasting works if we get beaten in the putIfAbsent
previous = rows.putIfAbsent(new DecoratedKey(key.token, allocator.clone(key.key)), empty);
if (previous == null)
{
previous = empty;
initialSize += 1;
}
}
final Pair<Long, Long> pair = previous.addAllWithSizeDelta(cf, allocator, localCopyFunction, indexer);
currentSize.addAndGet(pair.left);
currentSize.addAndGet(initialSize + pair.left);
currentOperations.addAndGet(cf.getColumnCount() + (cf.isMarkedForDelete() ? 1 : 0) + cf.deletionInfo().rangeCount());
return pair.right;
}