Solr
  1. Solr
  2. SOLR-1822

SEVERE: Unable to move index file from: tempfile to: indexfile

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Duplicate
    • Affects Version/s: 1.4
    • Fix Version/s: 3.1, 4.0-ALPHA
    • Component/s: replication (java)
    • Labels:
      None
    • Environment:

      Linux, JDK6,SOLR 1.4

      Description

      SOLR index directory remvoed,but do not know what the reasons for this.

      I add some codes on SnapPuller.java 577 line can reslove this bug.
      line 576
      File indexFileInIndex = new File(indexDir, fname);
      +
      if (!indexDir.exists()) indexDir.mkdir();
      boolean success = indexFileInTmpDir.renameTo(indexFileInIndex);

        Issue Links

          Activity

          Hide
          Faizan Aziz added a comment -

          Complete logs:
          Jul 31, 2012 6:59:49 AM org.apache.solr.handler.SnapPuller copyAFile
          SEVERE: Unable to move index file from: /opt/solr/multicore/1011/data/index.20120731065949/_9x.tis to: /mnt/multicore/1011/data/index.20120731050740/_9x.tisTrying to do a copy
          Jul 31, 2012 6:59:49 AM org.apache.solr.handler.SnapPuller copyAFile
          SEVERE: Unable to copy index file from: /opt/solr/multicore/1011/data/index.20120731065949/_9x.tis to: /mnt/multicore/1011/data/index.20120731050740/_9x.tis
          java.io.FileNotFoundException: /mnt/multicore/1011/data/index.20120731050740/_9x.tis (No such file or directory)
          at java.io.FileOutputStream.open(Native Method)
          at java.io.FileOutputStream.<init>(FileOutputStream.java:209)
          at java.io.FileOutputStream.<init>(FileOutputStream.java:160)
          at org.apache.solr.common.util.FileUtils.copyFile(FileUtils.java:48)
          at org.apache.solr.handler.SnapPuller.copyAFile(SnapPuller.java:585)
          at org.apache.solr.handler.SnapPuller.copyIndexFiles(SnapPuller.java:621)
          at org.apache.solr.handler.SnapPuller.fetchLatestIndex(SnapPuller.java:317)
          at org.apache.solr.handler.ReplicationHandler.doFetch(ReplicationHandler.java:268)
          at org.apache.solr.handler.ReplicationHandler$1.run(ReplicationHandler.java:149)

          Show
          Faizan Aziz added a comment - Complete logs: Jul 31, 2012 6:59:49 AM org.apache.solr.handler.SnapPuller copyAFile SEVERE: Unable to move index file from: /opt/solr/multicore/1011/data/index.20120731065949/_9x.tis to: /mnt/multicore/1011/data/index.20120731050740/_9x.tisTrying to do a copy Jul 31, 2012 6:59:49 AM org.apache.solr.handler.SnapPuller copyAFile SEVERE: Unable to copy index file from: /opt/solr/multicore/1011/data/index.20120731065949/_9x.tis to: /mnt/multicore/1011/data/index.20120731050740/_9x.tis java.io.FileNotFoundException: /mnt/multicore/1011/data/index.20120731050740/_9x.tis (No such file or directory) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:209) at java.io.FileOutputStream.<init>(FileOutputStream.java:160) at org.apache.solr.common.util.FileUtils.copyFile(FileUtils.java:48) at org.apache.solr.handler.SnapPuller.copyAFile(SnapPuller.java:585) at org.apache.solr.handler.SnapPuller.copyIndexFiles(SnapPuller.java:621) at org.apache.solr.handler.SnapPuller.fetchLatestIndex(SnapPuller.java:317) at org.apache.solr.handler.ReplicationHandler.doFetch(ReplicationHandler.java:268) at org.apache.solr.handler.ReplicationHandler$1.run(ReplicationHandler.java:149)
          Hide
          Faizan Aziz added a comment -

          ok.... The fix by kafka0102 is there so I guess the patch is not needed.... However I am still getting the error

          SEVERE: Unable to copy index file from: /opt/solr/multicore/1011/data/index.20120731065949/_9x.tis to: /mnt/multicore/1011/data/index.20120731050740/_9x.tis

          Note: /opt/solr/multicore is a symlink to /mnt/multicore

          Show
          Faizan Aziz added a comment - ok.... The fix by kafka0102 is there so I guess the patch is not needed.... However I am still getting the error SEVERE: Unable to copy index file from: /opt/solr/multicore/1011/data/index.20120731065949/_9x.tis to: /mnt/multicore/1011/data/index.20120731050740/_9x.tis Note: /opt/solr/multicore is a symlink to /mnt/multicore
          Hide
          Faizan Aziz added a comment -

          I am getting the same error for solr 3.5.0. On close analysis of SnapPuller.java I notice that the fix mentioned in the attachment is not done

          Show
          Faizan Aziz added a comment - I am getting the same error for solr 3.5.0. On close analysis of SnapPuller.java I notice that the fix mentioned in the attachment is not done
          Hide
          Grant Ingersoll added a comment -

          Bulk close for 3.1.0 release

          Show
          Grant Ingersoll added a comment - Bulk close for 3.1.0 release
          Hide
          kafka0102 added a comment -
          Show
          kafka0102 added a comment - I find the resolved work: https://issues.apache.org/jira/browse/SOLR-1995 .
          Hide
          kafka0102 added a comment - - edited

          I found the problem's reason.It's tmpDir's name same to indexDir's name. tmpIdxDirName's format is SnapShooter.DATE_FMT = "yyyyMMddhhmmss"(hh is between 1-12). If I have a indexDirName index.20101122031000 because of a full index repl at 2010-11-22 03:10:00. And slave's repl duration is 5 minitues. So at 2010-11-22 15:10:00, the slave made indexDirName and indexDirName both index.20101122031000, and finnaly will drop the index.After that,replication would generate the above error again and again.

          So,just let SnapShooter.DATE_FMT = "yyyyMMddHHmmss" would be fine.

          Show
          kafka0102 added a comment - - edited I found the problem's reason.It's tmpDir's name same to indexDir's name. tmpIdxDirName's format is SnapShooter.DATE_FMT = "yyyyMMddhhmmss"(hh is between 1-12). If I have a indexDirName index.20101122031000 because of a full index repl at 2010-11-22 03:10:00. And slave's repl duration is 5 minitues. So at 2010-11-22 15:10:00, the slave made indexDirName and indexDirName both index.20101122031000, and finnaly will drop the index.After that,replication would generate the above error again and again. So,just let SnapShooter.DATE_FMT = "yyyyMMddHHmmss" would be fine.
          Hide
          Hoss Man added a comment -

          Bulk updating 240 Solr issues to set the Fix Version to "next" per the process outlined in this email...

          http://mail-archives.apache.org/mod_mbox/lucene-dev/201005.mbox/%3Calpine.DEB.1.10.1005251052040.24672@radix.cryptio.net%3E

          Selection criteria was "Unresolved" with a Fix Version of 1.5, 1.6, 3.1, or 4.0. email notifications were suppressed.

          A unique token for finding these 240 issues in the future: hossversioncleanup20100527

          Show
          Hoss Man added a comment - Bulk updating 240 Solr issues to set the Fix Version to "next" per the process outlined in this email... http://mail-archives.apache.org/mod_mbox/lucene-dev/201005.mbox/%3Calpine.DEB.1.10.1005251052040.24672@radix.cryptio.net%3E Selection criteria was "Unresolved" with a Fix Version of 1.5, 1.6, 3.1, or 4.0. email notifications were suppressed. A unique token for finding these 240 issues in the future: hossversioncleanup20100527
          Hide
          Otis Gospodnetic added a comment -

          When Solr starts, doesn't it create the index directory? If so, this patch is not needed, unless we want to make sure replication succeeds even if someone/something removes the whole index directory on a slave after the slave had already started.

          Is this reeeeally needed?

          Show
          Otis Gospodnetic added a comment - When Solr starts, doesn't it create the index directory? If so, this patch is not needed, unless we want to make sure replication succeeds even if someone/something removes the whole index directory on a slave after the slave had already started. Is this reeeeally needed?
          Hide
          wyhw whon added a comment -

          Add SnapPuller.patch

          Show
          wyhw whon added a comment - Add SnapPuller.patch

            People

            • Assignee:
              Mark Miller
              Reporter:
              wyhw whon
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development