You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Michael McCandless (JIRA)" <ji...@apache.org> on 2008/04/27 12:46:55 UTC

[jira] Created: (LUCENE-1274) Expose explicit 2-phase commit in IndexWriter

Expose explicit 2-phase commit in IndexWriter
---------------------------------------------

                 Key: LUCENE-1274
                 URL: https://issues.apache.org/jira/browse/LUCENE-1274
             Project: Lucene - Java
          Issue Type: New Feature
          Components: Index
    Affects Versions: 2.3.1, 2.3, 2.2, 2.1, 2.0.0, 1.9
            Reporter: Michael McCandless
            Assignee: Michael McCandless
            Priority: Minor
             Fix For: 2.4


Currently when IndexWriter commits, it does so with a two-phase
commit, internally: first it prepares all the new index files, syncs
them; then it writes a new segments_N file and syncs that, and only if
that is successful does it remove any now un-referenced index files.

However, these two phases are done privately, internal to the commit()
method.

But when Lucene is involved in a transaction with external resources
(eg a database), it's very useful to explicitly break out the prepare
phase from the commit phase.

Spinoff from this thread:

  http://mail-archives.apache.org/mod_mbox/lucene-java-dev/200804.mbox/%3C16627610.post@talk.nabble.com%3E



-- 
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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1274) Expose explicit 2-phase commit in IndexWriter

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

Michael McCandless updated LUCENE-1274:
---------------------------------------

    Attachment: LUCENE-1274.patch

Attached patch.  I plan to commit in a few days.

> Expose explicit 2-phase commit in IndexWriter
> ---------------------------------------------
>
>                 Key: LUCENE-1274
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1274
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: Index
>    Affects Versions: 1.9, 2.0.0, 2.1, 2.2, 2.3, 2.3.1
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.4
>
>         Attachments: LUCENE-1274.patch
>
>   Original Estimate: 336h
>  Remaining Estimate: 336h
>
> Currently when IndexWriter commits, it does so with a two-phase
> commit, internally: first it prepares all the new index files, syncs
> them; then it writes a new segments_N file and syncs that, and only if
> that is successful does it remove any now un-referenced index files.
> However, these two phases are done privately, internal to the commit()
> method.
> But when Lucene is involved in a transaction with external resources
> (eg a database), it's very useful to explicitly break out the prepare
> phase from the commit phase.
> Spinoff from this thread:
>   http://mail-archives.apache.org/mod_mbox/lucene-java-dev/200804.mbox/%3C16627610.post@talk.nabble.com%3E

-- 
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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Resolved: (LUCENE-1274) Expose explicit 2-phase commit in IndexWriter

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

Michael McCandless resolved LUCENE-1274.
----------------------------------------

    Resolution: Fixed

> Expose explicit 2-phase commit in IndexWriter
> ---------------------------------------------
>
>                 Key: LUCENE-1274
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1274
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: Index
>    Affects Versions: 1.9, 2.0.0, 2.1, 2.2, 2.3, 2.3.1
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.4
>
>         Attachments: LUCENE-1274.patch
>
>   Original Estimate: 336h
>  Remaining Estimate: 336h
>
> Currently when IndexWriter commits, it does so with a two-phase
> commit, internally: first it prepares all the new index files, syncs
> them; then it writes a new segments_N file and syncs that, and only if
> that is successful does it remove any now un-referenced index files.
> However, these two phases are done privately, internal to the commit()
> method.
> But when Lucene is involved in a transaction with external resources
> (eg a database), it's very useful to explicitly break out the prepare
> phase from the commit phase.
> Spinoff from this thread:
>   http://mail-archives.apache.org/mod_mbox/lucene-java-dev/200804.mbox/%3C16627610.post@talk.nabble.com%3E

-- 
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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1274) Expose explicit 2-phase commit in IndexWriter

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592639#action_12592639 ] 

Michael McCandless commented on LUCENE-1274:
--------------------------------------------

I plan to rename abort() to rollback() (deprecating abort()), then add
a new method "prepareCommit()" to IndexWriter.  If you call this, then
IndexWriter is left in a mode where a commit is pending.  You must
follow this up either with a call to rollback(), which reverts all
changes done since you first opened IndexWriter and closes it, or
commit(), which completes the transaction.  prepareCommit() requires
that IndexWriter is opened with autoCommit false.



> Expose explicit 2-phase commit in IndexWriter
> ---------------------------------------------
>
>                 Key: LUCENE-1274
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1274
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: Index
>    Affects Versions: 1.9, 2.0.0, 2.1, 2.2, 2.3, 2.3.1
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.4
>
>   Original Estimate: 336h
>  Remaining Estimate: 336h
>
> Currently when IndexWriter commits, it does so with a two-phase
> commit, internally: first it prepares all the new index files, syncs
> them; then it writes a new segments_N file and syncs that, and only if
> that is successful does it remove any now un-referenced index files.
> However, these two phases are done privately, internal to the commit()
> method.
> But when Lucene is involved in a transaction with external resources
> (eg a database), it's very useful to explicitly break out the prepare
> phase from the commit phase.
> Spinoff from this thread:
>   http://mail-archives.apache.org/mod_mbox/lucene-java-dev/200804.mbox/%3C16627610.post@talk.nabble.com%3E

-- 
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: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org