[infinispan-issues] [JBoss JIRA] (ISPN-4710) DistributedSegmentReadLocker should be allowed to skip ReadLocks on small files

Sanne Grinovero (JIRA) issues at jboss.org
Wed Sep 10 09:14:19 EDT 2014


     [ https://issues.jboss.org/browse/ISPN-4710?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sanne Grinovero updated ISPN-4710:
----------------------------------
    Description: 
Both of these methods:
 - {{org.infinispan.lucene.readlocks.DistributedSegmentReadLocker.deleteOrReleaseReadLock(String)}}
 - {{org.infinispan.lucene.readlocks.DistributedSegmentReadLocker.realFileDelete(FileReadLockKey, AdvancedCache<Object, Integer>, AdvancedCache<?, ?>, AdvancedCache<?, ?>, boolean)}}

Are performing a lot of unnecessary operations - potentially on synchronous clustered caches - as we know in advance that files which are not being chunked don't need a read lock, and are not being chunked in smaller pieces (which affects how we delete things).

The determining factor between the two styles is defined in:
{{org.infinispan.lucene.impl.DirectoryLuceneV4.openInput(String, IOContext)}}

{code}   @Override
   public IndexInput openInput(final String name, final IOContext context) throws IOException {
      final IndexInputContext indexInputContext = impl.openInput(name);
      if ( indexInputContext.readLocks == null ) {
         return new SingleChunkIndexInput(indexInputContext);
      }
      else {
         return new InfinispanIndexInput(indexInputContext);
      }
   }{code}

  was:
Both of these methods:
 - {{org.infinispan.lucene.readlocks.DistributedSegmentReadLocker.deleteOrReleaseReadLock(String)}}
 - {{org.infinispan.lucene.readlocks.DistributedSegmentReadLocker.realFileDelete(FileReadLockKey, AdvancedCache<Object, Integer>, AdvancedCache<?, ?>, AdvancedCache<?, ?>, boolean)}}

Are performing a lot of unnecessary operations - potentially on synchronous clustered caches - as we know in advance that files which are not being chunked don't need a read lock, and are not being chunked in smaller pieces (which affects how we delete things).

The determining factor between the two styles is defined in:
{{org.infinispan.lucene.impl.DirectoryLuceneV4.openInput(String, IOContext)}}

{code}@Override
   public IndexInput openInput(final String name, final IOContext context) throws IOException {
      final IndexInputContext indexInputContext = impl.openInput(name);
      if ( indexInputContext.readLocks == null ) {
         return new SingleChunkIndexInput(indexInputContext);
      }
      else {
         return new InfinispanIndexInput(indexInputContext);
      }
   }{code}



> DistributedSegmentReadLocker should be allowed to skip ReadLocks on small files
> -------------------------------------------------------------------------------
>
>                 Key: ISPN-4710
>                 URL: https://issues.jboss.org/browse/ISPN-4710
>             Project: Infinispan
>          Issue Type: Enhancement
>          Components: Lucene Directory
>            Reporter: Sanne Grinovero
>            Assignee: Gustavo Fernandes
>             Fix For: 7.0.0.Beta2
>
>
> Both of these methods:
>  - {{org.infinispan.lucene.readlocks.DistributedSegmentReadLocker.deleteOrReleaseReadLock(String)}}
>  - {{org.infinispan.lucene.readlocks.DistributedSegmentReadLocker.realFileDelete(FileReadLockKey, AdvancedCache<Object, Integer>, AdvancedCache<?, ?>, AdvancedCache<?, ?>, boolean)}}
> Are performing a lot of unnecessary operations - potentially on synchronous clustered caches - as we know in advance that files which are not being chunked don't need a read lock, and are not being chunked in smaller pieces (which affects how we delete things).
> The determining factor between the two styles is defined in:
> {{org.infinispan.lucene.impl.DirectoryLuceneV4.openInput(String, IOContext)}}
> {code}   @Override
>    public IndexInput openInput(final String name, final IOContext context) throws IOException {
>       final IndexInputContext indexInputContext = impl.openInput(name);
>       if ( indexInputContext.readLocks == null ) {
>          return new SingleChunkIndexInput(indexInputContext);
>       }
>       else {
>          return new InfinispanIndexInput(indexInputContext);
>       }
>    }{code}



--
This message was sent by Atlassian JIRA
(v6.3.1#6329)


More information about the infinispan-issues mailing list