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

Clarify BackupRepository.createDirectory() semantics

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 9.0, 8.8.2
    • None
    • Backup/Restore
    • None

    Description

      The BackupRepository abstraction (used by backup code to plug in various storage backends) has a createDirectory method with ambiguous semantics. In short, it's unclear whether the method is intended to act as mkdir or mkdir -p. Should it create any missing parent directories, or should it error out if a parent directory doesn't exist?

      Solr's current backup code avoids running afoul of this mostly by coincidence. Anywhere that nested directories are used, backup code makes a createDirectory call for each one. But this has allowed the different implementations to diverge. LocalFileSystemRepository throws an error if a parent directory doesn't exist, but HdfsBackupRepository quietly creates any missing parent directories.

      We should decide how we want this to behave, so that BackupRepository will serve as a better general purpose API for file/directory storage. Once decided, existing implementations should be brought into line.

      Attachments

        Activity

          People

            Unassigned Unassigned
            gerlowskija Jason Gerlowski
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: