Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-11556

Backup/Restore with multiple BackupRepository objects defined results in the wrong repo being used.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 6.3
    • 8.3
    • Backup/Restore
    • None

    Description

      I defined two repos for backup/restore, one local and one remote on GCS, e.g.

      <backup>
          <repository name="hdfs" class="org.apache.solr.core.backup.repository.HdfsBackupRepository" default="false">
           ...
          </repository>
          <repository name="local" class="org.apache.solr.core.backup.repository.LocalFileSystemRepository" default="false">
                <str name="location">/tmp/solr-backups</str>
          </repository>
       </backup>
      

      Since the CollectionHandler does not pass the "repository" param along, once the BackupCmd gets the ZkNodeProps, it selects the wrong repo!

      The error I'm seeing is:

      2017-10-26 17:07:27.326 ERROR (OverseerThreadFactory-19-thread-1-processing-n:host:8983_solr) [   ] o.a.s.c.OverseerCollectionMessageHandler Collection: product operation: backup failed:java.nio.file.FileSystemNotFoundException: Provider "gs" not installed
              at java.nio.file.Paths.get(Paths.java:147)
              at org.apache.solr.core.backup.repository.LocalFileSystemRepository.resolve(LocalFileSystemRepository.java:82)
              at org.apache.solr.cloud.BackupCmd.call(BackupCmd.java:99)
              at org.apache.solr.cloud.OverseerCollectionMessageHandler.processMessage(OverseerCollectionMessageHandler.java:224)
              at org.apache.solr.cloud.OverseerTaskProcessor$Runner.run(OverseerTaskProcessor.java:463)
              at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:229)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:748)
      

      Notice the Local backup repo is being selected in the BackupCmd even though I passed repository=hdfs in my backup command, e.g.

      curl "http://localhost:8983/solr/admin/collections?action=BACKUP&name=foo&collection=foo&location=gs://tjp-solr-test/backups&repository=hdfs"
      

      I think the fix here is to include the repository param, see patch. I'll fix for the next 7.x release and those on 6 can just apply the patch here.

      Attachments

        1. SOLR-11556.patch
          17 kB
          Mikhail Khludnev
        2. SOLR-11556.patch
          16 kB
          Mikhail Khludnev
        3. SOLR-11556.patch
          13 kB
          Mikhail Khludnev
        4. SOLR-11556.patch
          1 kB
          Timothy Potter

        Activity

          People

            mkhl Mikhail Khludnev
            thelabdude Timothy Potter
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: