|
|
Choosing A Webhost: |
[jira] Commented: (JCS-15) Removing entries using a name group does not rem: msg#00043jakarta.turbine.jcs.devel
[ https://issues.apache.org/jira/browse/JCS-15?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12482011 ] Aaron Smuts commented on JCS-15: -------------------------------- I understand the problem. When using the internal lru for key storage the disk cache cannot do partial removes properly. It's remving from an interator that is a copy of the underlying LRU. Hence, it has no effect. I will either change the iterator, or change the remove call for partial keys. > Removing entries using a name group does not remove them from the disk cache. > ----------------------------------------------------------------------------- > > Key: JCS-15 > URL: https://issues.apache.org/jira/browse/JCS-15 > Project: JCS > Issue Type: Bug > Components: Indexed Disk Cache > Affects Versions: jcs-1.2.7.9.2 > Reporter: Kevin Preece > Assigned To: Aaron Smuts > Priority: Critical > > The scenario is that I add entries to the cache using name groups, e.g. using > keys "0:key0", "0:key1", "1:key0", etc. then issue a remove using a name > group, e.g. "0:". > If all the entries are in memory the remove succeeds. However if some or all > have been spooled out to disk those that have been spooled out do not get > removed from the cache. The code fragment and cache.ccf at the end of this > post show the problem. I'm looking at the source checked out of trunk this > morning and IndexedDiskCache.java last changed on 2006-09-22 with revision id > 449025 (I originally spotted this issue in release 1.2.7.9.2). Two problems > that are immediately obvious are: > 1. The lookup on line 660 always returns null unless I have an item in the > cache with key exactly equal to "0:" (which I don't). I think it should be > "keyHash.get( k )" > 2. The iter.remove() on line 662 appears to be operating on a copy of the > keys. > I've not tested it, but it looks like the else-if block for GroupId keys > suffers the same problems. Also if optimization is enabled for the disk file > I suspect data corruption will occur eventually, but again I've not tested > this. > Unfortunately this has stopped us using JCS because we rely on this > functionality working since our cache is too big to fit entirely in memory. > try > { > JCS cache = JCS.getInstance( "GeneralCache" ); > > for ( int ii = 0; ii < 100; ++ii ) > { > for ( int jj = 0; jj < 10; ++jj ) > { > final String k = jj + ":key" + ii; > final String d = "Some data for key " + k; > > cache.put( k, d ); > } > } > System.out.println( cache.get( "0:key0" ) ); > cache.remove( "0:" ); > // Next line should print "null" > System.out.println( cache.get( "0:key0" ) ); > } > catch ( CacheException e ) > { > e.printStackTrace(); > } > try > { > JCS cache = JCS.getInstance( "GeneralCache2" ); > > for ( int ii = 0; ii < 100; ++ii ) > { > for ( int jj = 0; jj < 10; ++jj ) > { > final String k = jj + ":key" + ii; > final String d = "Some data for key " + k; > > cache.put( k, d ); > } > } > System.out.println( cache.get( "0:key0" ) ); > cache.remove( "0:" ); > // Next line should print "null" > System.out.println( cache.get( "0:key0" ) ); > } > catch ( CacheException e ) > { > e.printStackTrace(); > } > The contents of cache.ccf are: > # DEFAULT CACHE REGION > jcs.default=DC > jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes > jcs.default.cacheattributes.MaxObjects=1 > jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache > # PRE-DEFINED CACHE REGIONS > jcs.region.GeneralCache=DC > jcs.region.GeneralCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes > jcs.region.GeneralCache.cacheattributes.MaxObjects=1 > jcs.region.GeneralCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache > jcs.region.GeneralCache.cacheattributes.UseMemoryShrinker=true > jcs.region.GeneralCache.cacheattributes.MaxMemoryIdleTimeSeconds=3600 > jcs.region.GeneralCache.cacheattributes.ShrinkerIntervalSeconds=60 > jcs.region.GeneralCache.cacheattributes.MaxSpoolPerRun=500 > jcs.region.GeneralCache.elementattributes=org.apache.jcs.engine.ElementAttributes > jcs.region.GeneralCache.elementattributes.IsEternal=false > jcs.region.GeneralCache2= > jcs.region.GeneralCache2.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes > jcs.region.GeneralCache2.cacheattributes.MaxObjects=2000 > jcs.region.GeneralCache2.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache > jcs.region.GeneralCache2.cacheattributes.UseMemoryShrinker=true > jcs.region.GeneralCache2.cacheattributes.MaxMemoryIdleTimeSeconds=3600 > jcs.region.GeneralCache2.cacheattributes.ShrinkerIntervalSeconds=60 > jcs.region.GeneralCache2.cacheattributes.MaxSpoolPerRun=500 > jcs.region.GeneralCache2.elementattributes=org.apache.jcs.engine.ElementAttributes > jcs.region.GeneralCache2.elementattributes.IsEternal=false > # AVAILABLE AUXILIARY CACHES > jcs.auxiliary.DC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory > jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes > jcs.auxiliary.DC.attributes.DiskPath=cache-files > jcs.auxiliary.DC.attributes.maxKeySize=100000 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [jira] Resolved: (JCS-21) JCS has inconsistent locking of shared data, Aaron Smuts (JIRA) |
|---|---|
| Next by Date: | [jira] Created: (JCS-22) IllegalStateException and NullPointerException thrown by CompositeCacheManager, Michael Jordan (JIRA) |
| Previous by Thread: | [jira] Commented: (JCS-15) Removing entries using a name group does not remove them from the disk cache., Aaron Smuts (JIRA) |
| Next by Thread: | [jira] Closed: (JCS-3) File Optimization expensive in memory and disk space, Aaron Smuts (JIRA) |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |