mirror of https://github.com/apache/cassandra
Invalidate all caches on table drop
patch by Aleksey Yeschenko; reviewed by Benedict Elliott Smith for CASSANDRA-7561
This commit is contained in:
parent
561f6ef5cf
commit
23233b384a
|
|
@ -1,4 +1,5 @@
|
|||
2.1.0-rc6
|
||||
* Invalidate all caches on table drop (CASSANDRA-7561)
|
||||
* Skip strict endpoint selection for ranges if RF == nodes (CASSANRA-7765)
|
||||
* Fix Thrift range filtering without 2ary index lookups (CASSANDRA-7741)
|
||||
* Add tracing entries about concurrent range requests (CASSANDRA-7599)
|
||||
|
|
|
|||
|
|
@ -372,8 +372,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
|
|||
data.unreferenceSSTables();
|
||||
indexManager.invalidate();
|
||||
|
||||
CacheService.instance.invalidateRowCacheForCf(metadata.cfId);
|
||||
CacheService.instance.invalidateKeyCacheForCf(metadata.cfId);
|
||||
invalidateCaches();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -2286,15 +2285,12 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
|
|||
|
||||
private void invalidateCaches()
|
||||
{
|
||||
CacheService.instance.invalidateKeyCacheForCf(metadata.cfId);
|
||||
CacheService.instance.invalidateRowCacheForCf(metadata.cfId);
|
||||
|
||||
if (metadata.isCounter())
|
||||
for (CounterCacheKey key : CacheService.instance.counterCache.getKeySet())
|
||||
if (key.cfId == metadata.cfId)
|
||||
CacheService.instance.counterCache.remove(key);
|
||||
CacheService.instance.invalidateCounterCacheForCf(metadata.cfId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return true if @param key is contained in the row cache
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -310,6 +310,17 @@ public class CacheService implements CacheServiceMBean
|
|||
}
|
||||
}
|
||||
|
||||
public void invalidateCounterCacheForCf(UUID cfId)
|
||||
{
|
||||
Iterator<CounterCacheKey> counterCacheIterator = counterCache.getKeySet().iterator();
|
||||
while (counterCacheIterator.hasNext())
|
||||
{
|
||||
CounterCacheKey counterCacheKey = counterCacheIterator.next();
|
||||
if (counterCacheKey.cfId.equals(cfId))
|
||||
counterCacheIterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
public void invalidateCounterCache()
|
||||
{
|
||||
counterCache.clear();
|
||||
|
|
|
|||
Loading…
Reference in New Issue