Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6D9F641D0 for ; Sun, 12 Jun 2011 10:29:17 +0000 (UTC) Received: (qmail 10114 invoked by uid 500); 12 Jun 2011 10:29:16 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 9955 invoked by uid 500); 12 Jun 2011 10:29:16 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 9948 invoked by uid 99); 12 Jun 2011 10:29:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Jun 2011 10:29:16 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Jun 2011 10:29:13 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 91EEF414105 for ; Sun, 12 Jun 2011 10:28:51 +0000 (UTC) Date: Sun, 12 Jun 2011 10:28:51 +0000 (UTC) From: "Michael McCandless (JIRA)" To: dev@lucene.apache.org Message-ID: <131900695.717.1307874531594.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <399304996.13714.1307795099716.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (LUCENE-3193) TwoPhaseCommit interface MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LUCENE-3193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13048290#comment-13048290 ] Michael McCandless commented on LUCENE-3193: -------------------------------------------- Patch looks great! It's a nice addition. TwoPhaseCommitTool.execute should be @experimental? This seems similar to LUCENE-3131 (XA transactions support). I don't really understand what it takes to be "XA capable", but I assume it means building the right wrapper around IW's existing transactional APIs (like this). Shouldn't TwoPhaseCommit be @lucene.experimental instead (not internal)? Ie, the idea is an app can also impl this interface, and then use execute to commit all resources. Javadocs should maybe state that on rollback the writer will have been closed? (rollback closes the writer) One possible issue: if exceptions are hit in .commit(), which ought to be rare since prepareCommit does all the "hard work", we go and .rollback() all resources, even those that had successfully .commit'd, right? But, in general, this is tricky for a resource to handle (rolling back when commit had succeeded). EG, IndexWriter won't do this correctly -- rollback will be a no-op in this case since it rolls back to the last successful commit. This is actually correctable, but it requires some more work to properly wrap the IndexWriter. > TwoPhaseCommit interface > ------------------------ > > Key: LUCENE-3193 > URL: https://issues.apache.org/jira/browse/LUCENE-3193 > Project: Lucene - Java > Issue Type: New Feature > Components: core/index > Reporter: Shai Erera > Assignee: Shai Erera > Fix For: 3.3, 4.0 > > Attachments: LUCENE-3193.patch > > > I would like to propose a TwoPhaseCommit interface which declares the methods necessary to implement a 2-phase commit algorithm: > * prepareCommit() > * commit() > * rollback() > The prepare/commit ones have variants that take a (Map commitData) following the ones we have in IndexWriter. > In addition, a TwoPhaseCommitTool which implements a 2-phase commit amongst several TPCs. > Having IndexWriter implement that interface will allow running the 2-phase commit algorithm on multiple IWs or IW + any other object that implements the interface. > We should mark the interface @lucene.internal so as to not block ourselves in the future. This is pretty advanced stuff anyway. > Will post a patch soon -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org