Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-2592

Add static readSnapshotsInfo to PersistentSnapshotDeletionPolicy

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 3.1, 4.0-ALPHA
    • core/index
    • None
    • New, Patch Available

    Description

      PSDP persists the snapshots information in a Directory. When you open PSDP, it obtains a write lock on the snapshots dir (by keeping an open IndexWriter), and updates the directory when snapshots are created/released.

      This causes problem in the following scenario – you have two processes, one updates the 'content' index and keeps PSDP open (because it also takes snapshots). Another process wants to read the existing snapshots information and open a read-only IndexReader on the 'content' index. The other process cannot read the existing snapshots information, because p1 keeps a write lock on the snapshots directory.

      There are two possible solutions:

      1. Have PSDP open the IndexWriter over the directory for each snapshot/release. A bit expensive, and unnecessary.
      2. Introduce a static readSnapshotsInfo on PSDP which accepts a Directory and returns the snapshots information. IMO it's cleaner, and won't have the performance overhead of opening/closing the IW as before.

      I'll post a patch (implementing the 2nd approach) shortly. I'd appreciate any comments.

      Attachments

        1. LUCENE-2592.patch
          5 kB
          Shai Erera

        Activity

          People

            shaie Shai Erera
            shaie Shai Erera
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: