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

Solr index restore silently copies the corrupt segments in the backup

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The Solr core restore functionality uses following criteria to decide if a given file is copied from backup directory or from current index directory.

      case 1] File is available in both backup and current index directory
      --> Compare the checksum and file length
      --> If checksum and length matching, copy the file from current working directory.
      --> If the checksum and length doesn't match, copy the file from backup directory.

      case 2] File is available in only in backup directory (This can happen for a newly created core without any data).
      --> Copy the file from backup directory.

      Now the problem here is that we intentionally catch and ignore the error while reading the checksum for a file in the backup directory. Hence in case (2), it will result into restoration of a file without appropriate "checksum".

      Here is the relevant code snippet,
      https://github.com/apache/lucene-solr/blob/a5586d29b23f7d032e6d8f0cf8758e56b09e0208/solr/core/src/java/org/apache/solr/handler/RestoreCore.java#L82-L95

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              hgadre Hrishikesh Gadre
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: