You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Shai Erera (JIRA)" <ji...@apache.org> on 2010/08/10 12:34:15 UTC

[jira] Created: (LUCENE-2592) Add static readSnapshotsInfo to PersistentSnapshotDeletionPolicy

Add static readSnapshotsInfo to PersistentSnapshotDeletionPolicy
----------------------------------------------------------------

                 Key: LUCENE-2592
                 URL: https://issues.apache.org/jira/browse/LUCENE-2592
             Project: Lucene - Java
          Issue Type: Improvement
          Components: Index
            Reporter: Shai Erera
            Assignee: Shai Erera
            Priority: Minor
             Fix For: 3.1, 4.0


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:
# Have PSDP open the IndexWriter over the directory for each snapshot/release. A bit expensive, and unnecessary.
# 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Updated: (LUCENE-2592) Add static readSnapshotsInfo to PersistentSnapshotDeletionPolicy

Posted by "Shai Erera (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-2592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shai Erera updated LUCENE-2592:
-------------------------------

    Attachment: LUCENE-2592.patch

Patch adds readSnapshotsInfo as well as a test case.

> Add static readSnapshotsInfo to PersistentSnapshotDeletionPolicy
> ----------------------------------------------------------------
>
>                 Key: LUCENE-2592
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2592
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>            Reporter: Shai Erera
>            Assignee: Shai Erera
>            Priority: Minor
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2592.patch
>
>
> 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:
> # Have PSDP open the IndexWriter over the directory for each snapshot/release. A bit expensive, and unnecessary.
> # 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] Resolved: (LUCENE-2592) Add static readSnapshotsInfo to PersistentSnapshotDeletionPolicy

Posted by "Shai Erera (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-2592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shai Erera resolved LUCENE-2592.
--------------------------------

    Resolution: Fixed

Committed revision 987811 (3x).
Committed revision 987814 (trunk).

> Add static readSnapshotsInfo to PersistentSnapshotDeletionPolicy
> ----------------------------------------------------------------
>
>                 Key: LUCENE-2592
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2592
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>            Reporter: Shai Erera
>            Assignee: Shai Erera
>            Priority: Minor
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2592.patch
>
>
> 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:
> # Have PSDP open the IndexWriter over the directory for each snapshot/release. A bit expensive, and unnecessary.
> # 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org