Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-3504

CopyOnRead directory should not schedule a copy task for non existent file

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.0.23, 1.2.8, 1.3.9, 1.4
    • lucene
    • None

    Description

      CopyOnWriteDirectory currently schedules a copy task for file which does exist. This eventually results in FileNotFoundException and that gets logged as warning. In normal usage this should not happen at the first place i.e. look up of non existent file. However in case of corruption it is seen that Lucene tries to lookup segment files with increasing generation number and they flood the log with such exception.

      In such a case no scheduling of file copy should be done and instead lookup call should be directly delegated to remote directory

      28.09.2015 12:11:08.745 *WARN* [oak-lucene-0] org.apache.jackrabbit.oak.plugins.index.lucene.IndexCopier Error occurred while copying file [segments_25y] from OakDirectory@5970597 lockFactory=org.apache.lucene.store.NoLockFactory@51b451b4 to NIOFSDirectory@/usr/cq/repository/index/e5a943cdec3000bd8ce54924fd2070ab5d1d35b9ecf530963a3583d43bf28293/2 lockFactory=NativeFSLockFactory@/usr/cq/repository/_cqa/repository/index/e5a943cdec3000bd8ce54924fd2070ab5d1d35b9ecf530963a3583d43bf28293/2
      java.io.FileNotFoundException: segments_25y
      	at org.apache.jackrabbit.oak.plugins.index.lucene.OakDirectory.openInput(OakDirectory.java:133)
      	at org.apache.lucene.store.Directory.copy(Directory.java:185)
      	at org.apache.jackrabbit.oak.plugins.index.lucene.IndexCopier$CopyOnReadDirectory$1.run(IndexCopier.java:312)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
      	at java.lang.Thread.run(Thread.java:767)
      

      Attachments

        Activity

          People

            chetanm Chetan Mehrotra
            chetanm Chetan Mehrotra
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: