Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-4710

DistributedSegmentReadLocker should be allowed to skip ReadLocks on small files

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 7.0.0.CR1
    • None
    • Lucene Directory
    • None

      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)

         @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);
            }
         }

              gfernand@redhat.com Gustavo Fernandes (Inactive)
              sgrinove Sanne Grinovero (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: